What’s the URL?

A URL is a Uniform Resource Locator. In other words, a URL is the address of a Resource that can be located

A URL is made up of several parts, some of which are required and some optional.

URL= Protocol + Domain Name (Damain Name)+ Port + Path the file + Parameters + Anchor

Look at an example 🌰 URL=http://www.example.com: 80 / path/to/myfile. HTML? Key1 = value1 & key2 = value2 # TheDocument

  1. Protocol = HTTP
  2. Domain Name (Damain Name) = www.example.com
  3. Port = :80
  4. Path (Path THR file) = / Path /to/myfile.html
  5. Parameters = key1=value1&key2=value2
  6. Anchor = #TheDocument

Explanation:

  1. HTTP is a protocol that also includes HTTPS, mailto (opening mail clients), or FTP (handling file transfers).
  2. www.example.com represents the Web server that is requesting www.example.com. You can also use an IP address (192.168.12.123 (the IP for this example)), but IP addresses are not easy to remember, so domain names are created.
  3. A port represents a technical “gate” for accessing resources on a Web server. If a Web server grants access to its resources using the standard port of the HTTP protocol (80 for HTTP and 443 for HTTPS), it is generally ignored. Otherwise it is mandatory.
  4. /path/to/myfile. HTML indicates the path of resources on the network server, that is, the to folder under the path folder and the myfile. HTML file under the to folder
  5. ? Key1 = valuE1&key2 =value2 are additional arguments provided to the network server. These parameters are a list of key/value pairs separated by ampersand. The Web server can use these parameters to perform additional operations before returning the resource. Each Web server has its own rules about parameters, and the only reliable way to know if a particular Web server handles parameters is by asking the Web server owner.
  6. #TheDocument This is an anchor to the browser, not sent to the requested server. Anchor points just seem to support Chinese!!

IP (Internet Protocol) address

An IP address is a string of numbers assigned to each device connected to a network that uses the Internet protocol. If you know the IP address of the Web server, how can you know the address of the Web server if you know the domain name?

You need to use the Domain Name System (DNS).

Several special IP addresses

  1. 127.0.0.1 indicates itself
  2. Localhost Indicates itself by host
  3. 0.0.0.0 does not represent any device

Use the ping command

Ping is used to check whether the target IP address is communicating properly with the current device, especially for a LOCAL area network (LAN).

Take two examples 🌰🌰

  • ping baidu.com

  • Ping 192.168.1.1(address of my router)

Latency (estimated time for round-trip trips) is significantly lower than Baidu.com due to attribute LAN access

Ping /?

DNS Domain Name System (DNS)

The Domain Name System (DNS) is a hierarchical and decentralized naming System for Internet connection resources. DNS maintains a list of domain names and corresponding resources such as IP addresses.

The most prominent feature of DNS is to translate easy-to-remember domain names (e.g. Mozilla.org) into digital IP addresses (e.g. 151,106,5,172). This mapping from domain names to IP addresses is called a DNS lookup, and its counterpart, a DNS reverse lookup (rDNS), is used to find the domain name corresponding to an IP address.

Tip: a domain name can correspond to multiple IP addresses, so that a single server can not withstand the pressure, so that outsiders do not understand the saying is load balancing. An IP can also correspond to multiple domain names, so that outsiders do not understand the statement is shared host (is it because of poor? 🧐).

Nslookup (DNS lookup) command

\

Nslookup/nslookup /

The domain name

A domain name is an alternate name for an IP address

The IP addresses of Baidu.com are 220.181.38.148 and 39.156.69.79, whereas the domain names of these two IP addresses are baidu.com·

Domain name relationship

Com is a top-level domain name xxx.com is a level 2 domain name www.xxx.com is a level 3 domain name (commonly known as level 2)

www.xxx.com and xxx.com do not have the same domain name, so why can www.baidu.com and baidu.com enter baidu home page? Because Baidu has carried out corresponding operations. When baidu.com is entered, Baidu server receives the request. Then redirect to www.baidu.com

The WWW has no real use, and some browsers have removed it from the address bar