Use ensp software to simulate DNS server experiment

DNS server introduction:

A DNS server (Domain Name Server, Domain Name Server) is a server that converts domain names and their corresponding IP addresses. It plays the role of mapping human-friendly domain names to corresponding machine-recognizable IP addresses.

The DNS server keeps a table of domain names and corresponding IP addresses to resolve the domain names of messages. When a user enters a web address in the computer, the DNS server will query and return the IP address corresponding to the web address. This IP address will then be used to designate and communicate with the target server. Therefore, the DNS server can be regarded as one of the most basic service facilities in the Internet.

It is worth noting that the DNS server does not directly resolve domain names into IP addresses, but completes this process through multi-level recursive queries. If a DNS server cannot resolve a domain name, it will forward the request to other DNS servers until it finds a DNS server that can resolve it.

In addition, in addition to querying from the DNS server of the local operator, users can also choose to use a public DNS server to speed up access to a specific website, or to enhance privacy protection. For example, Google provides a free public DNS server with the IP address 8.8.8.8

DNS domain name resolution process:

1. Enter the www.qq.com domain name in the browser , and the operating system will first check whether there is such a domain name in its local hosts file.
Address mapping relationship, if there is, call this IP address mapping first to complete domain name resolution.
2. If there is no mapping of this domain name in hosts , search the cache of the local DNS resolver to see if there is a mapping relationship of this URL,
If yes, return directly to complete domain name resolution.
3. If there is no corresponding URL mapping relationship between hosts and the local DNS resolver cache, it will first look for the one set in the TCP/IP parameter
The preferred DNS server, here we call it a local DNS server, when this server receives a query, if the domain name to be queried, the package
If it is included in the local configuration area resources, the resolution result will be returned to the client to complete the domain name resolution, which is authoritative.
4. If the domain name to be queried is not resolved by the local DNS server area, but the server has cached the URL mapping relationship, then
Call this IP address mapping to complete domain name resolution, which is not authoritative.
5. If the local zone file and cache resolution of the local DNS server are both invalid, then according to the settings of the local DNS server (whether
If forwarding mode is not used, the local DNS will send the request to 13 root DNS servers , and the root DNS server will receive
After receiving the request, it will determine who is authorized to manage the domain name (.com) , and will return an IP responsible for the top-level domain name server .
local DNS server
After receiving the IP information, the server responsible for the .com domain will be contacted . After the server responsible for the .com domain receives the request, if
If it cannot resolve it by itself, it will find a DNS server address that manages qq.com and give it to the local DNS server . When the local DNS service
After the server receives this address, it will find the qq.com domain server, repeat the above actions, and search until it finds www.qq
.com host.
6. If the forwarding mode is used, the local DNS server will forward the request to the upper-level DNS server, and the upper-level server will
For analysis, if the upper-level server cannot resolve, or find the root DNS or forward the request to the upper-level, and then cycle. find the last
The result is returned to the local DNS server, and the DNS server then returns to the client.
Note: From the client to the local DNS server is a recursive query, and the interactive query used between DNS servers is an iterative query
inquire.
114.114.114.114 is the common DNS of China Mobile, China Telecom and China Unicom . It can be used on mobile phones and computers. It is clean and has no advertisements.
The analysis success rate is relatively higher, domestic users use more, and the speed is relatively fast and stable, it is commonly used by domestic users to surf the Internet
DNS . _
8.8.8.8 is the DNS provided by GOOGLE . This address is universal. Relatively speaking, it is more suitable for foreign countries and visiting foreign countries.
Users of the Site

Simulation experiment:

First you need the equipment:

a switch

Two servers: one for HTTP service and one for DNS service

A PC: for testing the ping function

A Client machine: used to simulate the browsing function (because the PC of ensp does not have this function)

Topology:

 Implementation:

1. First configure the ip address for all devices:

PC: 192.168.1.1, Client: 192.168.1.2 HTTP server: 192.168.1.10 DNS server: 192.168.1.20

2. Place resource files on the HTTP server: 

 3. Try to use ip access on the client side:

 4. Configure the domain name and ip address on the DNS server and enable the DNS service

5. Try to use the domain name to access the file on the Client:

You can also use the PC to ping the domain name for detection:

 

 

Guess you like

Origin blog.csdn.net/qq_68163788/article/details/130040077