Enable the Ubuntu local DNS Cache function to accelerate browsing

Source: Internet
Author: User
Tags nameserver
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.