When we access network resources through a domain name, such as opening a webpage or using the FTP service, the system needs to request the IP address pointed to by the domain name from the DNS server. By default, the Windows system caches the obtained results so that they can be used directly during next access, greatly reducing interaction with the DNS server. Ubuntu sends a request to the DNS server every time, resulting in slow response! 1. Install dnsmasq as the DNS server, build a bridge between the local server and the real DNS server, and use dnsmasq
When we access network resources through a domain name, such as opening a webpage or using the FTP service, the system needs to request the IP address pointed to by the domain name from the DNS server. By default, the Windows system caches the obtained results so that they can be used directly during next access, greatly reducing interaction with the DNS server. Ubuntu sends a request to the DNS server every time, resulting in slow response!
1. Install dnsmasq as the DNS server, build a bridge between the local server and the real DNS server, and use the dnsmasq cache function to speed up.
Sudo apt-get install dnsmasq
2. if the machine accesses the Internet through a local area, IP Address/DNS server information is allocated by the DHCP server, and www.linuxidc.com opens/etc/dhcp3/dhclient. conf removes the following line of comment, so that when the DHCP Client is enabled, dnsmasq will be used as the priority DNS Server
Prepend domain-name-servers 127.0.0.1;
3. Add nameserver 127.0.0.1 to the DNS server/etc/resolv. conf, which is applicable to fixed IP addresses.
# Generated by NetworkManager
Nameserver 127.0.0.1
Nameserver Local Wireless Route IP
Dns provided by nameserver ISP