Analysis of URL

1. What parts does the URL contain and what does each part do?

Uniform Resource Locator URL full name: Uniform Resource Locator, which consists of six parts:

  • Protocol: The main protocol has two parts: HTTPS and HTTP. It defines the format of the request and response.
  • Domain name or IP. A domain name is equivalent to an alternate name for IP. It is a string representing IP. The purpose of IP is to locate a machine.
  • Port, each machine has multiple ports, that is, each machine can provide a variety of different services, a computer has about 60000+ ports, and 0~1023 ports can only be provided for internal administrators, users can only use the port after 1024, the command to specify the port, for example, in the cmder command line tool input command: Http-server-c-1 -p 1024 In short, port and IP are indispensable, TP positioning machine, port positioning service.
  • Path, a string, determines which page you want to visit.
  • A query string that represents the content of the page to view, such as the page number.
  • Anchors, the location of the document, indicate which specific section of the content to look at.

Complete URL, for example, HTTPS :(protocol)//www.baidu.com(domain name)/S(path)? Wd =he…

2. What is the function of DNS? How to use nslookup command?

The Domain Name System (DNS) is used to match Domain names with IP addresses. You can run the nslookup command to check the IP addresses of the domain name. On the CLI, enter nslookup baidu.com to check the IP addresses of the domain name.

3. What is the function of IP? How does ping work?

An Internet Protocal is used to accurately locate a device and encapsulate data packets for communication with other devices (at least one independent IP address is available on the Internet).

IP is divided into external IP and internal IP. The external IP is an IP other than the router, while the internal IP is the IP created by the router to provide devices connected to the router WiFi.

The ping command is used to find out which IP address the domain name corresponds to. A domain name may have one or multiple IP addresses. For example, ping qq.com

4. What are domain names and what are their types?

A domain name is another name for IP. It is important to note that a domain name can have multiple IP addresses. This is called load balancing, in order to prevent one machine from being overwhelmed. A single IP can also correspond to a different domain name. This is called shared hosting, which can be used by cash-strapped developers and start-up companies.

Domain names fall into three main categories

  1. Com, the most common, calls this type of domain a top-level domain.
  2. Baidu.com is called the secondary domain name
  3. www.baidu.com is a three-level domain name.