Results 1 to 7 of 7

Thread: debug /etc/hosts

  1. #1
    Join Date
    Jan 2008
    Location
    Chicago, IL
    Beans
    19
    Distro
    Ubuntu 11.04 Natty Narwhal

    debug /etc/hosts

    Ok, so I have read and covered all the bases here:
    http://ubuntuforums.org/showthread.php?t=562716

    And have managed my hosts file without hiccups for many years now, but lately it seems like it only listens to me half the time. So, either I picked up a bad habit recently that is causing mayhem and breaking things, or I am going crazy.

    Background: I run a local LAMP stack for web development. Oftentimes I will just create a hosts entry to mimic the site I am working on. It seems, in the past year or so, that this only works 'sometimes'. Right, I know there's no voodoo powering my name resolution. However, its been so odd that at times I have power cycled the laptop just as a last resort. I can't go on much longer and need to understand this elephant in the room.

    So, tl; dr;, here are my questions:
    1)Can something tell my browser(FF normally, but tested & reproduced in chrome, not that it should matter, caching aside) to ignore the hosts file?
    2)Is there a way of debugging name resolution? I think dig & nslookup ignore /etc/hosts so what are my options?
    3)I don't think this is the case, but when updating hosts should I restart any services?
    4)Similar to one, but is there a chance anything in my home(~) can over write hosts?

    I know my apache virtual host is setup right as I tend to clone sites-available files and modify the domains/folders, so that is probabkly not my problem. Also, this is 11.04, fresh install, with the exception of my /home partition.

    Any help would be appreciated, thanks!

  2. #2
    Join Date
    Jun 2011
    Location
    Atlanta Georgia
    Beans
    1,769
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: debug /etc/hosts

    /etc/hosts takes priority over your nameserver, so if there is an entry there it will be used in place of what nslookup would return.

    You need to remove the entry and restart networking for it to take effect.

    Code:
    sudo /etc/init.d/networking restart
    If that doesn't work for you let me know.

  3. #3
    Join Date
    Jan 2008
    Location
    Chicago, IL
    Beans
    19
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: debug /etc/hosts

    Thanks Dangertux, but no luck. Same problem.

    Ome thing I noticed that I've never seen on the network restart is this:
    Ignoring unknown interface wlan0=wlan0.

    Not sure if it's relevant. Service restart otherwise returns OK


    nslookup returns:
    stk@stk-HP-G56-u1104:~$ nslookup http://sub.domain.com
    Server: 192.168.43.1
    Address: 192.168.43.1#53
    ** server can't find http://sub.domain.com: SERVFAIL

    Quite frustrating, as I need to get some work done and my only alternative is to wait for the proper DNS to propagate :/

  4. #4
    Join Date
    Jun 2011
    Location
    Atlanta Georgia
    Beans
    1,769
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: debug /etc/hosts

    Quote Originally Posted by stkrzysiak View Post
    Thanks Dangertux, but no luck. Same problem.

    Ome thing I noticed that I've never seen on the network restart is this:
    Ignoring unknown interface wlan0=wlan0.

    Not sure if it's relevant. Service restart otherwise returns OK


    nslookup returns:
    stk@stk-HP-G56-u1104:~$ nslookup http://sub.domain.com
    Server: 192.168.43.1
    Address: 192.168.43.1#53
    ** server can't find http://sub.domain.com: SERVFAIL

    Quite frustrating, as I need to get some work done and my only alternative is to wait for the proper DNS to propagate :/
    Would you mind posting the contents of your /etc/resolv.conf file.

  5. #5
    Join Date
    Jan 2008
    Location
    Chicago, IL
    Beans
    19
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: debug /etc/hosts

    stk@stk-HP-G56-u1104:~$ cat /etc/resolv.conf
    # Generated by NetworkManager
    nameserver 192.168.43.1


    Looks normal to me?

  6. #6
    Join Date
    Jan 2008
    Location
    Chicago, IL
    Beans
    19
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: debug /etc/hosts

    Believe it or not, this problem is back again. The last time I had this issue I had a laptop crash, restored, and created some new host entries for other projects and sure enough the sites worked. But now, I have tried a new one, and same problem. Sigh.

  7. #7
    Join Date
    Jul 2008
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: debug /etc/hosts

    Quote Originally Posted by stkrzysiak View Post
    Believe it or not, this problem is back again. The last time I had this issue I had a laptop crash, restored, and created some new host entries for other projects and sure enough the sites worked. But now, I have tried a new one, and same problem. Sigh.
    What does your /etc/hosts file look like? What exactly happens in FF when you have a problem?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •