Results 1 to 4 of 4

Thread: 0.0.0.0 resolving to localhost?

  1. #1
    Join Date
    Dec 2007
    Location
    ur LHC leakin ur protons
    Beans
    87
    Distro
    Kubuntu 10.04 Lucid Lynx

    Red face 0.0.0.0 resolving to localhost?

    I'm seeing an odd problem with my networking. Ping, ssh, telnet and web browsers (Firefox, Chromium beta) resolve 0.0.0.0 as localhost or 127.0.0.1.

    Code:
    $ ping 0.0.0.0
    PING 0.0.0.0 (127.0.0.1) 56(84) bytes of data.
    64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.061 ms
    64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.048 ms
    64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.047 ms
    ^C
    I'm pretty sure this shouldn't be happening.

    Code:
    $ cat /etc/hosts
    127.0.0.1	localhost.localdomain localhost
    127.0.1.1	vostro-1.gasketnet.local vostro-1
    
    192.168.23.222	office2
    192.168.23.232	office3
    192.168.23.233	office4
    192.168.23.231	warehouse3
    
    $ nslookup 0.0.0.0 localhost
    Server:		localhost
    Address:	127.0.0.1#53
    
    ** server can't find 0.0.0.0.in-addr.arpa.: NXDOMAIN
    I don't want 0.0.0.0 resolving. Ideas anyone?

  2. #2
    Join Date
    Aug 2006
    Beans
    841

    Re: 0.0.0.0 resolving to localhost?

    0.0.0.0 is not a valid address, dont worry about it.

  3. #3
    Join Date
    Nov 2006
    Location
    Craggy Island.
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: 0.0.0.0 resolving to localhost?

    AFAIK I believe ping of 0.0.0.0 will go to the default route and your nic will respond to that ping request
    You can tell a man who boozes by the company he chooses, as the pig got up and slowly walked away.

  4. #4
    Join Date
    Dec 2007
    Location
    ur LHC leakin ur protons
    Beans
    87
    Distro
    Kubuntu 10.04 Lucid Lynx

    Cool Re: 0.0.0.0 resolving to localhost?

    Thanks for the replies guys.

    Quote Originally Posted by eldragon View Post
    0.0.0.0 is not a valid address, dont worry about it.
    I wish that was a good solution for me, but I need 0.0.0.0 available for when I have to use an invalid address (for instance, blocking in my hosts file. I don't want to use 127.0.0.1 because I don't want the bogus requests continuing to drive my local web server nutty). Are there any other legal invalid addresses? I can't think of any.

    Quote Originally Posted by jonobr View Post
    AFAIK I believe ping of 0.0.0.0 will go to the default route and your nic will respond to that ping request
    That's what I'm seeing in practise. I guess my routing table is messed up. I'm not great at using the route command, I can never figure out the syntax (I come from BSD, where the route command is slightly easier to use ).

    By the way, on WinXP a "ping 0.0.0.0" comes back with "Destination specified is invalid", which I believe is the correct response. (XP uses the NetBSD networking stack, AFAIK.)

    Code:
    $ route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    10.22.5.0       *               255.255.255.0   U     0      0        0 eth0
    link-local      *               255.255.0.0     U     1000   0        0 eth0
    default         10.22.5.2       0.0.0.0         UG    0      0        0 eth0
    default         10.22.5.2       0.0.0.0         UG    100    0        0 eth0
    That's definitely not right. I have two default entries and that pesky link-local that keeps popping up in routing tables across my networks.

    Offtopic "D'oh!" moment: I had some trouble recently with nslookup. I was trying to figure out why it was ignoring my hosts file. I didn't realise it ignores the hosts file completely and goes directly to the nameserver. (BSD nslookup does not do this.)

    ===========================

    Apparently that didn't fix anything. 0.0.0.0 still resolves. Obvious, now that I think about it...

    Code:
    $ route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    10.22.5.0       *               255.255.255.0   U     0      0        0 eth0
    default         10.22.5.2       0.0.0.0         UG    100    0        0 eth0
    $ ping 0.0.0.0
    PING 0.0.0.0 (127.0.0.1) 56(84) bytes of data.
    64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.058 ms
    64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.050 ms
    64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.040 ms
    ^C
    --- 0.0.0.0 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 1998ms
    rtt min/avg/max/mdev = 0.040/0.049/0.058/0.009 ms
    Last edited by Fatman_UK; August 13th, 2009 at 10:37 AM. Reason: Additional information

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
  •