For linux Network dns beginners, the linux dns information is usually stored in the/etc/resolv. conf file. Sh-# cat/etc/resolv. confnameserver 192.168.0.2nameserver 192.168.0.1/etc/resolv. the conventional format of conf is as follows: domainname www. xxx. xxxsearch www. ooo. ooonameserver primary_dns_servernameserver secondary_dns_server so nameserver is used to specify the IP address of the dns server. DNS, short for Domain Name System, is a core service of the Internet. It serves as a distributed database that maps domain names and IP addresses, allowing people to access the Internet more conveniently. Therefore, the IP address specified by nameserver is the IP address of a dns server, which is used to reflect the mutual relationship between domain names and IP addresses. Sh-3.2 # ping www. baidu. comPING www.a.shifen.com (115.239.210.27) 56 (84) bytes of data. ^ C ^ C64 bytes from 115.239.210.27: icmp_req = 1 ttl = 45 time = 508 MS --- www.a.shifen.com ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0 msrtt min/avg/max/mdev = 508.968/508.968/508.968/0.000 MS from the ping command output results can see www.baidu.com this domain name corresponding IP address. Enter the domain name and IP address of baidu in the browser to access this website. It turns out that dns is used to convert domain name to IP address. From this point of view, directly entering an IP address for access is theoretically more efficient. Why not directly entering an IP address for access? This is because domain names are usually relatively easy to remember. Who would like to remember IP addresses like 115.239.210.27? Is it not objective and convenient, even if it is subjective? Therefore, the Internet provides the dns service for convenience of human access to the network. So you enter www.baidu.com in your browser, and dns will help you convert it to 115.239.210.27. This is what dns does. Mobile phone --> wireless router --> internet my mobile phone connects to the internet through a wireless router, but it is found that gateway and nameserver are the same IP address. This is because the wireless router is a server, and the IP address of the mobile phone is allocated by the wireless router.