Results 1 to 8 of 8

Thread: [SOLVED] unable to ping localhost

Threaded View

  1. #1
    Join Date
    Aug 2005
    Location
    Bardstown, KY, USA
    Beans
    200
    Distro
    Ubuntu 11.04 Natty Narwhal

    Question [SOLVED] unable to ping localhost

    I feel stupid for asking this, but I've tried everything I know and can't figure it out.

    I can't ping 'localhost'.

    My /etc/hosts file:

    Code:
    127.0.0.1 localhost ubun2
    
    # The following lines are desirable for IPv6 capable hosts
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts

    My nsswitch.conf file:

    Code:
    passwd:         compat
    group:          compat
    shadow:         compat
    
    hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
    networks:       files
    
    protocols:      files
    services:       files
    ethers:         files
    rpc:            files
    
    netgroup:       nis

    nslookup localhost:

    Code:
    Server:         192.168.1.254
    Address:        192.168.1.254#53
    
    Non-authoritative answer:
    Name:   localhost
    Address: 127.0.0.1

    ping localhost:

    Code:
    ping: unknown host localhost

    What am I missing? It's like it's totally ignoring my hosts file, but why? nsswitch lists 'files' as the first option for hosts, so it should hit my hosts file first, right? This just started this week and I don't remember changing a single thing (but I won't deny the possibility).

    I first became aware of the problem when I tried to access the machine via NX and it connected and authenticated but then wouldn't finish loading, saying 'nxssh: localhost: Name or service not known'. I approached it as a problem with NX until I noticed that I couldn't even ping localhost on that machine.

    So, what's wrong?

    /Kevin
    Last edited by commonplace; April 25th, 2008 at 03:24 PM. Reason: Problem solved.

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
  •