DNS resolution acceleration for website URLs under Ubuntu10.10

Source: Internet
Author: User
Tags nameserver
It is actually very simple. That is, dnsmasq. However, the default Ubuntu10.10livecdi386 is only installed with-base, and the dnsmasq program is not installed. After using the url, the translation speed of the url into an ipv4 address is almost invisible. (Below the modern linux Browser firefox3.6.x is a prompt. During dns resolution, if the resolution time is too long, you can see what firefox is doing now. pending is often on the dns resolution step and sometimes waits.

It is actually very simple.

That is, dnsmasq.

However, the default Ubuntu 10.10 livecd i386 is only installed with-base, and the dnsmasq program is not installed.

After using the url, the translation speed of the url into an ipv4 address is almost invisible.
(The prompt below firefox 3.6.x in modern linux Browser is displayed. During dns resolution, if the resolution time is too long, you can see what firefox is doing now, and pending is often on the dns resolution step, sometimes it takes more than one second to wait, and each page has more than one second. In particular, some modern web sites, those web pages are combined with multiple pages. The dns resolution is slow and the loading of the entire web page is slow. One slow 1 second, this page... Wait for half a day .)

The speed of loading web pages with this small item has indeed increased.

The principle of this tool is actually very simple. Normally, every time I look for a url address, I want to send an application to the dns server, saying, "Please tell me, go to XX site, what is his ipv4 address?" Then, the dns service translates the url address into an ip address and replies it to the requesting computer, saying that the address you want is "com". In the actual ip address world, the address is a certain number. Now that the computer knows, it starts to send real data to the destination according to the Digital IP address.
Everything is done within several milliseconds.

But it does not seem so fast now. Therefore, acceleration is required. We try our best to migrate the request to a local computer for dns and translation.
As long as my local computer caches a translation result for a website that has been translated by dns, I will not frequently request the dns server if I go to the same website later. It achieves the goal of acceleration.

Dnsmasq installation method.

Xin lide, search for the package name, the super-small program, and then mark the installation and application. Complete.

Later. Configuration. You must have high permissions to modify the configuration file. I am going to first open sudo nautilus, the root permission file browser. Right-click any file you want to edit, and you can edit the file with the root permission.


The first one is/etc/dnsmasq. conf.
This line is originally commented out, and there is a well number # in front of the line to delete the well number. Change to this option and save it.
Listen-address = 127.0.0.1

Then, the second file,
/Etc/dhcp3/dhclient. conf
In this line, the prepend line has a well number by default, but it also has a well number at the beginning of the line. If the well number is removed, the parameter may not be 127.0.0.1. If it is changed to 127.0.0.1, it indicates that my local host has a part-time dns.
Prepend domain-name-servers 127.0.0.1, 1.2.3.4;
Save. (Note: replace 1.2.3.4 here with the ipv4 address of the online public dns server that you think is useful for. It is best to write 2nd IP addresses. If no IP address is set to 2nd, the second dns Server Resolution option may be your Gateway Router, but your gateway may not have dns resolution capabilities, which may cause problems. [LINUX community www.LinuxIDC.com ])

Then, the third/etc/resolv. conf
Because I am from Beijing xinunicom adsl. So,
The default value is adsl automatic dhcp, which is divided into two DNS servers.
Write down the two dns Server IP addresses. The ipv4 address behind the nameserver is.
Separated by commas (,), such as 127.0.0.1, 1.2.3.4, and 5.6.7.8.
Right-click the network management applet on The gnome panel, which is the network status icon of the network-manager 0.8.1 applet on the taskbar. By default, ubuntu has two upper and lower panels. It should be the top panel, which is the same as the input method, sound, and time.
(Different systems are not the best .)
Edit the dsl connection. Because I use this to start adsl, edit it.
On the dsl tab, select "edit" and "ipv4 Settings" for your frequently-used adsl connection, and change "automatic pppoe" to "automatic pppoe" to "address-only", "underground dns", where you can record the 2dns server you just noted down, isp points your, or your favorite, and writes them in the format of 127.0.0.1, 1.2.3.4, and 5.6.7.8 separated by commas.
Finished.
Resolv. the first line of the conf file. If there is a line with the search keyword, and you do not rely on your gateway as the dns server, you can delete it. After inserting a blank line in the first line, write nameserver 127.0.0.1

Save.

Then sudo/etc/init. d/dnsmasq restart

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.