Can ping computer by IP address but not by computer name

By imekul ยท 12 replies
May 29, 2008
  1. I am having a problem with one of the computers on my network -- call them Computers A, B, and C. Most of the time, other computers on the LAN (B and C) cannot ping Computer A by computer name; however, they can ping it by IP address, as well as access its shares using the IP.

    Sometimes, though, everything works perfectly, meaning I can ping computera or access \\computera\ to view shares. Most of the times, though, this doesn't work, and I have to use the IP to access it.

    Now, I've tried getting on this computer and trying the reverse (that is, ping Computer B or C on my network), and that works fine. So basically, it's the same story for both B and C -- they can ping A by IP address, and it's rare that they can by computer name. And A has no trouble pinging B or C, by IP or hostname.

    All computers are running XP Pro with SP2 or SP3. Computer A is connected wirelessly, and has no firewall running or other Internet security software.

    I have tried ipconfig /flushdns and ipconfig /registerdns. I have also tried resetting the TCP/IP stack on Computer A.

    So... any idea what gives? It's a crazy problem. I can't understand why it's sporadic, why sometimes I can access the computer by computer name, but most of the times I need to use the IP address.

    I think I have definitely narrowed the problem down to Computer A, since B and C respond the same way and can communicate with each other just fine. Initially, I wondered if something might be wrong with the DNS on the router, but since B and C have no problems with each other, I'm pretty sure the problem is with A itself.

    The only possible fix I can think of is to manually edit the HOSTS file in Windows on every computer on the network and map the computer name "computera" to its IP address. I'm guessing this would work, however I really don't want to do this. There are ~20 computers on the network, and I'd rather not have to do this.

    Finally, if it matters, my router is an old computer running IPCop, which is based on Squid Proxy, I believe.

    I'd love to hear any ideas on what could be causing this. Thanks!!

    - Luke
  2. tipstir

    tipstir TS Ambassador Posts: 2,477   +126


    I was going to tell you about the Master Browser to set one PC as that and turn off that feature on all of the other PCs. Wireless gets screwy with MB. Their is a program called Browstat.exe that is free from MS, but you need to search for the software. You install that in Windows folder. Then open a dos session and type:

    browstat -status

    It should report back which PC is the Master Browser and if you have one set for a backup browser. The Domain or Workgroup is okay. If you don't get this message then you got a problem with the Master Browser.

    Now another problem you got is IPCop can act-up when I was using it was it did that. But still if you have your router setup not to be ping block it won't work though.
  3. jobeard

    jobeard TS Ambassador Posts: 11,177   +990

    You are having a Name Resolution issue. The internet uses a DNS service to
    map names to ip-addresses. However, those are Public ip-addresses, not private
    Lan addresses. To solve this Windows uses multiple techniques:
    1. a Master Browser to record systems
    2. the host file
    If you have dependable ip-addresses (ie: static addresses or MAC enforced ip assignments),
    then you can enter the mapping into your host file (this is the technique I use).
    The host file is located at \windows\system32\drivers\etc\* and the format of the entry is
    ip-address (one or more spaces) theSystemName​

    The host file allows any system to be included, private (eg your desktop) and public
    (eg -- but make sure you get the ip-address correct!
  4. imekul

    imekul TS Rookie Topic Starter

    Thanks for the ideas, guys.

    @Tipstir -- I'm looking into the whole Master Browser thing. I had never even heard of it before you guys mentioned it.

    @jobeard -- Yeah, I kind of figured it was something with the name resolution. It just really perplexes me why this is happening.

    So just so I am clear, who (as in what computer) stores the record for the DNS entries? Is that the Master Browser? Or does the router store them? Basically, I'm kind of wondering what the procedure is for when I, say, run ping computera. Does my computer get in touch with the router and try to resolve computera's IP address? Or does it get in touch with the Master Browser?
  5. jobeard

    jobeard TS Ambassador Posts: 11,177   +990

    The router may have DHCP to assign addresses to your LAN devices, but it does not resolve any names,
    even if your TCP shows your router address as the DNS address. Any request the router
    receives on port 53 (ie DNS) is forwarded to the default gateway on the WAN side and thus up to your IP.

    ALL requests for NAMES (eg computera or need Name Resolution -- this occurs for all programs using TCP,
    eg ping is a program, IE7 is a program, and even access to \\computera\share accesses a program.

    the data flow goes like this
    program accessNamedResource ---> Name Resolution
                                   <---- replies with ip address or NOT FOUND
    program connects to ip-address ----> some resource
                                  <--- connection complete
    program then performs whatever ...
    For ALL Name resolution, first the Host file is accessed and if it is there,
    that answer is used.
    If not in Hosts, then the Local network is accessed (ie the Master Browser),
    and then your ISP DNS for Internet names.
  6. tipstir

    tipstir TS Ambassador Posts: 2,477   +126

    A lot of people haven't either, but with it you'll know if you have a internal network problem which needs to be fixed or not? I have friends who run some complex networks at home and until I told them about MB they've problems are gone.
  7. jobeard

    jobeard TS Ambassador Posts: 11,177   +990

    Great :) I've always used NSLOOKUP to prove DNS resolution
    but it only talks directly to a true DNS and does not resolve local LAN names as seen here:
    $ ping localRouter
    Pinging localRouter [] with 32 bytes of data:
    Reply from bytes=32 time=8ms TTL=250
    Reply from bytes=32 time<1ms TTL=250
    Reply from bytes=32 time<1ms TTL=250
    Reply from bytes=32 time<1ms TTL=250
    Ping statistics for
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 0ms, Maximum = 8ms, Average = 2ms
    Jeff@ltbeard ~
    $ nslookup !$
    nslookup localRouter
    *** can't find localRouter: Non-existent domain
    where my hosts file contains localRouter
  8. imekul

    imekul TS Rookie Topic Starter

    (Oops... didn't get the e-mail notifications for these latest replies!)

    Thanks for giving me more detail about the whole process of events. I just always assumed that the DNS translation was done by the router itself. I still find it crazy, though, that these problems are limited to one specific computer on the network.

    Here are the results of browstat status on two different computers:

    Performed on computer LUKE:
    Status for domain @HOME on transport \Device\NetBT_Tcpip_{EF09438E-9379-43D9-B93D-77AE7E6075D9}
        Browsing is active on domain.
        Master browser name is: LUKE
            Master browser is running build 2600
        2 backup servers retrieved from master LUKE
        There are 12 servers in domain @HOME on transport \Device\NetBT_Tcpip_{EF09438E-9379-43D9-B93D-77AE7E6075D9}
        There are 3 domains in domain @HOME on transport \Device\NetBT_Tcpip_{EF09438E-9379-43D9-B93D-77AE7E6075D9}
    Performed on a different PC on the network:
    Status for domain @HOME on transport \Device\NetBT_Tcpip_{83B8B86A-3C2D-44E7-B118-8CC434CC9A55}
        Browsing is active on domain.
        Master browser name is: LUKE
    Could not open key in registry, error = 5        Unable to determine build of browser master: 5
        \\\\LUKE          .  Version:05.01  Flags: 51603 NT POTENTIAL MASTER 
        2 backup servers retrieved from master LUKE
        There are 12 servers in domain @HOME on transport \Device\NetBT_Tcpip_{83B8B86A-3C2D-44E7-B118-8CC434CC9A55}
        There are 3 domains in domain @HOME on transport \Device\NetBT_Tcpip_{83B8B86A-3C2D-44E7-B118-8CC434CC9A55}
    I don't know if it's significant, but I can't even access the problematic computer (named RICK, by the way) by name from my computer, which happens to be the Master Browser, evidently.

    What's also odd is that new computers constantly hop on this network and are found easily enough by typing \\newcomputername\, so it's not as if the Master Browser is just not being updated or is no longer functioning.

    Thanks again for all of the info, guys. I sure hope I can get this thing solved. It's just not making any sense to me now, but maybe we can discover the cause (or at least the solution! =).

  9. tipstir

    tipstir TS Ambassador Posts: 2,477   +126

    1. download this file:;9944866;/fileinfo.html

    2. run it and type in this password: tip2008

    3. creates a C:\tipstir folder

    4. Run

    Master Browser PC -- YesMasterBrowser.reg (double click on run)
    Non Master Browser PCs - NoMasterBrowser.reg (double click on run)

    There are other tools in the package each have readme of that they do. But all you need to worry about is fixing the Master Browser problem.

    There should be only two PCs as Masterbrowser Master/Backup all the rest should have this feature disabled. That's what the NoMasterBrowser does.
  10. imekul

    imekul TS Rookie Topic Starter

    Thanks, Tipstir. I tried that out, and I ran the respective files on all the computers on the LAN. Still no success, though!

    I'm thinking more and more that this must be a problem caused by the particular computer in question (RICK), but I just can't understand why. It makes no sense to me...

    Anything else I can try? I'd love to figure this out.

    As a backup solution, using the Hosts file, is there any way to at least have one master hosts file on the network? If I had to manually add/modify the records on one computer, that would be okay... but we have nearly a dozen machines running here, and it would be a hassle trying to keep them all synchronized.
  11. jobeard

    jobeard TS Ambassador Posts: 11,177   +990

    SORRY, that doesn't work. That's why we normally don't use the host file -- one has to run about and update each one.
  12. tipstir

    tipstir TS Ambassador Posts: 2,477   +126

    On the PC that is giving you trouble run the other files like the one that ends with the works lite. Try that first before going to the works Pro. I had the same problem you're going through right now. That's why I made up those packs.
  13. imekul

    imekul TS Rookie Topic Starter

    Good news! It's working now! Although, I'm not sure exactly what "fixed" it. I ran both of your scripts there, and immediately after they finished, the problem still persisted. However -- and here's something interesting -- the router gave the computer in question a new IP address ( instead of Ever since the new IP was received, it seems to have been working flawlessly to access the computer via its name, as well as the IP.

    So I'm not sure what exactly fixed it, as it didn't work immediately after I tried any of the fixes, but I'm happy that it seems to be working now! Hopefully I don't have to deal with this again. :)

    Thanks for all the help, Tipstir. It's very much appreciated!
Topic Status:
Not open for further replies.

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...