Announcement

Collapse
No announcement yet.

Hostname lookup very slow

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hostname lookup very slow

    Hello all,

    I've been using Kubuntu 8.10 Intrepid Ibex since it was released, and it was working very well for the most part. A couple of days ago I (perhaps foolishly) enabled "Pre-released updates" and "Unsupported updates" in Adept, and upgraded my system to use the latest of all of these updates.

    Ever since then, my Internet access has slowed to a crawl. It seems like the problem is in hostname lookup. It takes perhaps 15-30 seconds to lookup a hostname such as google.com, but then once it finds the hostname it works at "normal" speed.

    Has anyone else had this problem? Does anyone have any advice on how I might correct it?

    Thanks!

    #2
    Re: Hostname lookup very slow

    What you are describing seems to me like a DNS (Domain Name Service) issue. Thats how hostnames get translated to IP addresses. I know the lag sometimes arises due to issues with IPv6 protocol, which, as far as I know, isn't really used much yet, if at all. If you have already eliminated any lag in access to the DNS servers for your network (i.e. anything that might be related if you are on a network at work or something), then you might have a look at this method for blacklisting the module. It's for 8.04 but probably would apply to 8.10 too and would be worth a try.
    https://help.ubuntu.com/community/We...ngSlowIPv6IPv4

    When I see this issue it is only on the initial lookup, after that lookups work as usual.

    Comment


      #3
      Re: Hostname lookup very slow

      tinker, thank you very much for the helpful response. Unfortunately it did not help. I've disabled ipv6 according to the page you referenced, and I've verified that the ipv6 module is not loaded, but I still suffer from slow hostname lookup.

      Any other ideas?

      Thanks again.

      Comment


        #4
        Re: Hostname lookup very slow

        Have you tried using a different dns server? I use OpenDNS and it works great!

        http://www.opendns.com/

        Comment


          #5
          Re: Hostname lookup very slow

          If you are connecting through a router (you didn't say), then check the router configuration settings for the DNS IP address. Verify with your ISP that they are correct, and if not, change them.
          Windows no longer obstructs my view.
          Using Kubuntu Linux since March 23, 2007.
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #6
            Re: Hostname lookup very slow

            Originally posted by jvoegele
            Any other ideas?
            You can test if it is a DNS issue causing the lag by surfing to a site or two with the site's IP address instead of the hostname. If it's faster by IP address then it is a DNS issue if it's not then we will have to look at something else for the cause.

            edit: It occurred to me that what I wrote might be more useful for you if I provided an IP address for you to use as I have no idea how technical you are. 209.85.173.147 is a google site, that should be a good enough test.

            Comment


              #7
              Re: Hostname lookup very slow

              Thank you all for your willingness to help me with this issue.

              I decided to roll back to a clean Kubuntu 8.10 install and to not enable the "Pre-released updates" and "Unsupported updates" features in Adept. Now hostname lookup is working just fine again.

              I don't know what exactly the issue was, but it was definitely related to some software upgrade in pre-released or unsupported updates repositories.

              Comment


                #8
                Re: Hostname lookup very slow

                I am reviving this old topic because, after working fine for several weeks my DNS problems have suddenly returned. This time I have not enabled the "Pre-released updates" and "Unsupported updates", but hostname lookup has slowed to a crawl again.

                In response to tinker's question, I have verified that using IP addresses instead of hostnames is very fast, so it does appear to be a DNS issue.

                In response to Snowhog's comments, I am connecting through a wireless router. I have two laptops and two desktop computers connected to this wireless router, but only my Kubuntu laptop has this slow hostname lookup problem. My wife's Windows laptop works fine, as do my Ubuntu and Windows desktop machines.

                Does anyone have any other suggestions to help identify and fix this problem?

                Comment


                  #9
                  Re: Hostname lookup very slow

                  jvoegele, I have a couple of suggestions for you. First, go to one of your other machines and check their DNS primary and secondary servers. In Windows, I think that the command is ipconfig /all. In Ubuntu, you should do a cat /etc/resolv.conf and note the lines that end with "nameserver", those are your DNS servers.

                  Then go to your problematic machine and put the same DNS servers in place. If you've a fixed IP address and since network manager is essentially broken, edit as root /etc/resolv.conf and put there the same IP addresses of your working machines.

                  You are now using the same DNS servers as the other machines that are working, so you should have the same speed for name lookup.

                  Not saying that the other people are wrong, but I've not ever needed to disable IPv6, and I don't see how it is related to your problem.

                  Comment


                    #10
                    Re: Hostname lookup very slow

                    Could a weird host lookup order in /etc/nsswitch.conf be to blame? Here's mine for reference, set up to use WINS, so the winbind package needs to be installed.
                    Code:
                    # /etc/nsswitch.conf
                    #
                    # Example configuration of GNU Name Service Switch functionality.
                    # If you have the `glibc-doc-reference' and `info' packages installed, try:
                    # `info libc "Name Service Switch"' for information about this file.
                    
                    passwd:     compat
                    group:     compat
                    shadow:     compat
                    
                    hosts:     files wins mdns4_minimal [NOTFOUND=return] dns mdns4
                    networks:    files
                    
                    protocols:   db files
                    services:    db files
                    ethers:     db files
                    rpc:      db files
                    
                    netgroup:    nis
                    The interesting line is the hosts one. Perhaps moving dns to an earlier position would help? Though I'm not at all sure what the difference between it and mdns4* is. So, backup before modifying. The effect should be instantaneous so should be easy to revert.
                    KDE, I heart thee.

                    Comment


                      #11
                      Re: Hostname lookup very slow

                      Hi there,

                      I googled the very same problem, and you article was the only one that showed up.

                      It to turned out that I had the same problem, very slow host name lookup, however lightning fast internet surfing by using ip address.

                      I installed bind9 (sudo apt-get install bind9) reset and low and behold dns look ups were back to being lightning fast using the new dns server of localhost (127.0.0.1).

                      Strange cause it wasn't anything to do with my dns servers as I use my laptop at multiple sites and at every site there was the same symptom.

                      Comment


                        #12
                        Re: Hostname lookup very slow

                        edbrum, thank you for the suggestion. Installing bind9 has resolved the slow hostname lookup problem for me, although I do wonder why doing so should be necessary all of a sudden.

                        Thanks also to everyone else who posted here in an effort to help.

                        Comment


                          #13
                          Re: Hostname lookup very slow

                          I am reviving this very old thread for posterity's sake because I have found the true cause of my very slow hostname lookup problems. It turns out that it had nothing to do with Kubuntu updates, but rather was caused by the vpnc vpn client. I use Kvpnc to connect to my company's VPN, and when I connect it creates a new network interface named tun0. When this new network interface was created, it had the side effect of adding a "search" entry to my /etc/resolv.conf referring to my company's private internal network. This search entry remained in my resolv.conf even after I disconnected from VPN and would cause every hostname lookup to first try my company's internal private network, finally timeout, and then find the real hostname...very slow.

                          I resolved this problem by removing the tun0 interface from the resolvconf setup with the following command:

                          Code:
                          sudo resolvconf -d tun0
                          After executing the above, hostname lookup was back to normal. The only problem is that every time I connect to VPN the tun0 interface returns and I have to remember to remove it again after the fact.

                          Hope this helps for anyone who has similar problems.

                          Comment


                            #14
                            Re: Hostname lookup very slow

                            Many thanks !!!
                            'sudo resolvconf -d tun0' removed the problem for me.

                            'vpnc-disconnect' usually removes the vpn related entries from '/etc/resolv.conf'. Not sure why it didn't happen !!

                            Comment

                            Working...
                            X