What is a URL?
We surf the Internet every day, but we don’t have a clear understanding of what happens when we surf the Internet. For example, to open a web page, you have to enter a url. What, you enter from the navigation page, so in fact the initial page of the navigation page url is input for you by the browser, you click the name or logo of a url to jump, also equivalent to the new page at the top of the input url. When we visit a website, we are actually accessing some content and services published on the Internet, that is, network resources.
URL (Uniform Resource Locator) URL (Uniform Resource Locator) Is a Uniform Resource Locator.
It represents the location of a web resource on a computer network and is the channel through which browsers retrieve any resource published on the Internet. Every web page on the Internet has a unique name identifier, a URL.
What are the parts of a URL?
We all see the URL in the address bar when we type it in and when we click to jump to a new page.
It mainly consists of six parts:
Protocol + Domain Name + Port + Path to the file + Parameters + Anchor
From left to right, protocol, domain name, port, path (the path of the resource on the network server), query parameters (extra parameters sent to the server), anchor points (this part is not sent to the server)
agreement
When we transfer data, when we share network resources, we have to follow certain protocols. There are many protocols, the most common of which are HTTP and HTTPS, which are the most widely used protocols on the Internet.
-
HTTP This resource is accessed through regular HTTP. Format: HTTP://
-
HTTPS Access the resource using secure HTTPS. Format: HTTPS://
-
In addition, there are FTP, for example, to access resources through FTP. Format: FTP://
The domain name
Baidu.com is the domain name, or the website you want to visit, without explanation
port
The default port number of the corresponding protocol scheme is used. For example, the default port number of HTTP is 80, and the default port number of HTTPS is 443. Generally, the default port number is used to access a url. Only in special cases, other specified ports are used. Different services can use different ports, a total of 65535 ports, theoretically speaking, is almost sufficient.
The path
A path can be a string separated by zero or more slashes, representing the address of a directory or file on the host. For example, the HTML file at the end of baidu.com/index.html is the path you want to access. The server host stored a lot of resources, you want to specific access to which resources, you need to enter the path, this is the same as our PC access to C disk, D disk storage content is the truth.
Query parameters
For example, you search the price of gold in Baidu, baidu.com/s?wd= gold. s? Wd = gold is the query parameter. Search engines return relevant search results based on your keywords. Of course, it can also be other properties of the parameters that you need to provide in advance to access specific content in the host repository. A query parameter can have multiple parameters separated by ampersand (&). The name and value of each parameter are separated by = ().
The anchor
Anchors are used to locate specific content on a page. For example, the homepage of news website is divided into many sections, including hot topics, entertainment, sports and so on. You click on the TAB of a section, which gives you a jump to the location of that section on the same page. This is the anchor point. Note that the anchor point is a purely user-local operation that does not send a request to the server.
What is DNS?
DNS (Domain Name System) is called Domain Name resolution in Chinese. After you enter the Domain Name of a website, the browser does not know which IP address to access or which terminal on the Internet to send your request to. Before sending a request, resolve the domain name. This is where DNS comes in. It will parse the domain name you enter and send the request to the IP address specified by the website server. DNS makes a match between a domain name and an IP address. In order to balance the load of users, a website usually uses multiple server IP addresses to process user access requests. This step, also using DNS to achieve, for example, the most common according to the location of the device you visit different servers to send requests.
The nslookup command is used to query DNS records and check whether domain name resolution is normal. It is used to diagnose network faults. Name server lookup, also known as the query service domain name. The nslookup command is used as follows:
-
Query the domain name of a website, for example, nslookup baidu.com
-
Queries that take some parameters are not explained here
What is IP?
Internet Protocol (IP) : Internet Interconnection Protocol.
IP forms the basis of the Internet. Based on end-to-end design principles, IP protocol provides a packet transfer service between networked devices. An IP address is a unique identifier that identifies the location of your device or terminal on the Internet.
IP mainly includes three aspects: IP address scheme, packet encapsulation format and packet forwarding rules.
IP addresses are classified into Intranet IP addresses and extranet IP addresses, which are isolated from each other and connected only through a router.
IP can not be described in detail, the long talk is not over, can only talk about some of the most preliminary understanding.
The ping command is used to check whether the local host is reachable to another host on the network. If the ping between the two hosts fails, the connection between the two hosts cannot be established.
To find out if the network is working, or if a website is connected, just ping it.
For example, bing, baidu.com
Within a certain period of time, if the local PC receives the reply packet, it indicates that the network connection between the local PC and the requested website is normal. If the local PC does not receive the reply packet, it indicates that the network connection is abnormal.
In addition to detecting whether a packet is reachable, the ping command can also calculate the delay time of a packet by using the difference between the reply time and the sending time.
What are the domain name types? .
Domain name types are also worth mentioning to dispel some common misconceptions and confusion. Take me for example, I used to think that visiting a website, WWW is a must, in fact, is a misunderstanding, because do not understand the domain name.
Domain names can be divided into:
- Root domain(the root of the domain name
.root
It is the same for all domain names, so it is usually omitted. - Top-level domain name (TLD) General top-level domain name (gTLD) (such as.com and.org) Country top-level domain name (ccTLD) (such as.cn,. IO, and. TV)
- Subdomain name (SLD) (written in front, e.g. Mail)
- Subdomain name (such as en, a specified display language)
- Level 3 Domain name (host name) (i.e. : WWW)