<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 119, comments - 62, trackbacks - 0, articles - 0
    firefox上網慢是由于解析域名需要太長時間造成的,解決辦法如下(有時間再翻譯成中文):

    Local DNS Cache for Faster Browsing on Ubuntu System

    by @ 8:57 am. Filed under Other Linux

     

    A DNS server resolves domain names into IP addresses. So when you request “yahoo.com” for example, the DNS server finds out the address for the domain, and sends your request the right way.

     

    You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. The difference is about 30-60 ms. Multiply that difference by the number of websites you visit a day for an approximate estimate of the speed improvement.

    The following instructions are for someone with a broadband internet connection, where the computer gets it’s local IP address using DHCP from the router in your home or office.

    Install dnsmasq in Ubuntu

    Dnsmasq is a lightweight, easy to configure, DNS forwarder and DHCP server. It is designed to provide DNS and optionally, DHCP, to a small network. It can serve the names of local machines which are not in the global DNS. The DHCP server integrates with the DNS server and allows machines with DHCP-allocated addresses to appear in the DNS with names configured either in each host or in a central configuration file. Dnsmasq supports static and dynamic DHCP leases and BOOTP for network booting of diskless machines.

    First you need to make sure that Universe repository is enabled in your sources.list file

    Install dnsmasq Using the following command

    sudo apt-get install dnsmasq

    uncomment the following line (remove “#” in the beginning) in the file /etc/dnsmasq.conf

    listen-address=127.0.0.1

    Now edit

    /etc/dhcp3/dhclient.conf

    and make sure the section below exactly like this, especially the line that says “prepend domain-name-servers 127.0.0.1;”

    #supersede domain-name “fugue.com home.vix.com”;
    prepend domain-name-servers 127.0.0.1;
    request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, host-name,
    netbios-name-servers, netbios-scope;

    In the normal case, when you get a new dhcp lease, the dhcp3 client (tool) on your computer gets a new lease, and updates the

    /etc/resolv.conf

    file on your computer with the right values for the DNS servers to use (usually some machine in the network of your hosting provider). Adding the “prepend” option as we did above ensures that “127.0.0.1″ will appear on the top of the list of DNS servers. That magic number refers to your own computer. So in the future, whenever your computer needs to resolve a domain name, it will forward that request to dnsmasq (which is running at 127.0.0.1 - your computer). If the details for the domain name are already in you cache, well and good, dnsmasq will serve it up and make the process real fast. If it is not in the cache, then dnsmasq will look at the /etc/resolv.conf file and use the nameservers listed below the “127.0.0.1″. I hope that explains things.

    Now open the file

    /etc/resolv.conf

    in your text editor. It probably looks like:

    search yourisp.com
    nameserver 217.54.170.023
    nameserver 217.54.170.024
    nameserver 217.54.170.026

    The 127.0.0.1 is missing right now since you haven’t renewed your lease after you edited the /etc/dhcp3/dhclient.conf file. So, let us add that in manually this one time. After you do, your /etc/resolv.conf file will look like the following:

    search yourisp.com
    nameserver 127.0.0.1
    nameserver 217.54.170.023
    nameserver 217.54.170.024
    nameserver 217.54.170.026

    Now you need to restart the dnsmasq using the following command

    sudo /etc/init.d/dnsmasq restart.

    Now you are running a local DNS cache.

    Testing Your Local DNS Cache

    If you want to measure your speed improvement, type the command

    dig yahoo.com

    You will see something like “;; Query time: 38 msec” there.

    Now type the command again, and you should see something like:”;; Query time: 2 msec”


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 国产免费AV片在线观看播放| 亚洲6080yy久久无码产自国产 | 又粗又长又爽又长黄免费视频| 99re热免费精品视频观看| 亚洲午夜精品久久久久久人妖| 在线涩涩免费观看国产精品| 亚洲日韩激情无码一区| 日本免费A级毛一片| 亚洲国产精品久久久天堂| 九九精品成人免费国产片| 亚洲国产精品久久久久| 日韩插啊免费视频在线观看| 久久久久亚洲av无码专区导航| 99国产精品免费视频观看| 亚洲一级毛片在线观| 亚洲色精品aⅴ一区区三区| avtt天堂网手机版亚洲| 99久久精品毛片免费播放| 亚洲国产另类久久久精品黑人| 免费福利在线视频| 亚洲色偷偷av男人的天堂 | 91视频国产免费| 亚洲精品无码成人| 亚洲男女内射在线播放| 大地资源网高清在线观看免费| 久久亚洲精品无码VA大香大香| 无码国产精品一区二区免费式直播| 亚洲最大的成人网站| 一区二区三区亚洲视频| 国产麻豆一精品一AV一免费 | 伊人久久五月丁香综合中文亚洲| 手机看片久久国产免费| 精品久久久久久无码免费| 亚洲久本草在线中文字幕| 最近中文字幕无免费视频| 一级毛片免费在线| 亚洲国产精品综合一区在线| 国产又黄又爽又刺激的免费网址| 久久er国产精品免费观看8| 亚洲制服丝袜在线播放| 免费人成在线观看网站品爱网日本|