Current location - Quotes Website - Collection of slogans - Linux domain name mapping ip and port Linux domain name mapping
Linux domain name mapping ip and port Linux domain name mapping
What is used to map a host domain name to an ip address?

The conversion from domain name to IP address realizes DNS (Domain Name System) through DNS protocol. As a distributed database mapping domain names and IP addresses on the Internet, users can access the Internet more conveniently without having to remember IP strings that can be directly read by machines.

The process of finally getting the IP address corresponding to the host name is called domain name resolution (or host name resolution).

DNS protocol runs on top of UDP protocol, using port number 53. In the RFC document, RFC2 18 1 specifies DNS, RFC2 136 specifies dynamic updating of DNS, and RFC2308 specifies reverse caching of DNS queries.

How to map domain names to IP addresses in dns servers?

The steps are as follows:

The resolution process of 1 and DNS mainly includes the following steps:

1. If you want to visit a website now, the client will issue a resolution request and send it to the local domain name server.

How to configure a domain name for the HOSTS file?

To add a network domain name to a host:

1) Location of hosts file: C:windowssystem32driversetc. Find the hosts file in the folder and open it with Notepad.

2) Add a separate line of records according to the format of ip address domain name. For example, 112.124.39.29 www.server1/kloc-0.com Note that there must be at least1spaces between the IP address and the domain name. Remember to save the file after modification.

3) How to know that the IP address of the domain name has taken effect: Please follow the following steps on the computer: Start-> Run-> Enter cmd-> Ping domain name-> Enter to check the result is similar to the reply of middle 220.181.31.183: bytes = 32time = 79mttl = 53+081.31. Press F5 several times to refresh. Modify the role of the host 1) to speed up domain name resolution. For frequently visited websites, you can configure the mapping relationship between domain name and ip in Hosts, so that when you enter the domain name, the computer can quickly resolve the IP without requesting the DNS server on the network. 2) Convenient for LAN users In many LANs, there will be servers for users to use. However, because there are few DNS servers in the local area network, it is quite troublesome for many people to enter difficult IP addresses to access these services. Now we can give these servers friendly names, and then set up IP mapping in Hosts, so that we can enter the name of this server when we visit later. 3) Blocking websites Many websites install various plug-ins on their computers without users' consent, some of which may be Trojans or viruses. For these websites, you can use the host to map the domain name of the website to the wrong IP or the IP of your own computer, so you don't have to visit it. For example, if you don't want to visit www.xxxx.com, just write the following contents on the host:127.0.0.1www.xxxx.com # blocked website 0.0.0 www.xxxx.com # blocked website, and let the computer resolve the domain name to the local computer or the wrong IP, so as to achieve the purpose of blocking.

4) Connect the system smoothly. For Lotus server and some database servers, if you directly enter the IP address when accessing, you cannot access it. You can only access them by entering the server name. Then configure the Hosts file so that you can connect smoothly by entering the server name. Finally, it should be pointed out that the mapping of the host file configuration is static. If the computer on the network changes, please update the IP address in time, otherwise it will be inaccessible.

5) Mandatory designation of the domain name corresponding to the IP address. When a new website has been uploaded to the server and needs debugging but does not want to be accessed by the outside world or crawled by spiders, you can modify the local hosts file, so that only your own computer can access the website through the domain name.