DNS problem, nslookup works, ping doesn't

前端 未结 14 954
無奈伤痛
無奈伤痛 2021-01-30 08:40

I am setting up a development server in my flat. I have set up an Ubuntu DNS server on it and have added the zone weddinglist (just weddinglist - no TLD. It\'s just an internal

相关标签:
14条回答
  • 2021-01-30 08:44

    I had the same issue. As pointed out by other answers ping and nslookup use different mechanisms to lookup an ip.

    Chances are you are trying to ping a machine not on the same domain. When you ping the fully qualified name of the server this should then work.

    nslookup works:

    PS C:\Users\Administrator> nslookup nuget
    Server:  ad-01.docs.com
    Address:  192.168.10.20
    
    Name:    nuget.docs.com
    Address:  192.168.10.17
    

    Ping fails:

    PS C:\Users\Administrator> ping nuget
    Ping request could not find host nuget. Please check the name and try again.
    

    Ping works, using FQDN:

    PS C:\Users\Administrator> ping nuget.docs.com
    
    Pinging nuget.docs.com [192.168.70.17] with 32 bytes of data:
    Reply from 192.168.10.17: bytes=32 time=1ms TTL=127
    Reply from 192.168.10.17: bytes=32 time=2ms TTL=127
    Reply from 192.168.10.17: bytes=32 time=2ms TTL=127
    Reply from 192.168.10.17: bytes=32 time=2ms TTL=127
    
    Ping statistics for 192.168.10.17:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 1ms, Maximum = 2ms, Average = 1ms
    

    To fix this you will need to alter the DNS setting for the machine and add the DNS suffix to lookup.

    1. Control Panel\Network and Internet\Network Connections
    2. Network adapter -> properties
    3. IPV4 -> Properties
    4. General tab -> Advanced
    5. DNS Tab
    6. Select "Append these DNS suffixes (in order)"
    7. Add the required domain names
    8. Disable, then enable your network adapter (don't do this on a VM, you'll loose your connection, instead try 'ipconfig /renew')

    Advanced TCP/IP Settings

    0 讨论(0)
  • 2021-01-30 08:45

    It's possible that the Windows internal resolver is adding '.local' to the domain name because there's no dots in it. nslookup wouldn't do that.

    To verify this possiblity, install 'Wireshark' (previously aka Ethereal) on your client machine and observe any DNS request packets leaving it when you run the ping command.


    OK, further investigation on my own XP machine at home reveals that for single label names (i.e. "foo", or "foo.") the system doesn't use DNS at all, and instead uses NBNS (NetBios Name Service).

    Using a hint found at http://www.chicagotech.net/netforums/viewtopic.php?t=1476, I found that I was able to force DNS lookups for single label domains by putting a single entry reading "." in the "Append these DNS suffixes (in order)" in the "Advanced TCP/IP settings" dialog

    0 讨论(0)
  • 2021-01-30 08:45

    I think this behavior can be turned off, but Window's online help wasn't extremely clear:

    If you disable NetBIOS over TCP/IP, you cannot use broadcast-based NetBIOS name resolution to resolve computer names to IP addresses for computers on the same network segment. If your computers are on the same network segment, and NetBIOS over TCP/IP is disabled, you must install a DNS server and either have the computers register with DNS (or manually configure DNS records) or configure entries in the local Hosts file for each computer.

    In Windows XP, there is a checkbox:

    Advanced TCP/IP Settings

    [ ] Enable LMHOSTS lookup

    There is also a book that covers this at length, "Networking Personal Computers with TCP/IP: Building TCP/IP Networks (old O'Reilly book)". Unfortunately, I cannot look it up because I disposed of my copy a while ago.

    0 讨论(0)
  • 2021-01-30 08:45

    If you can ping the FQDN, look at how DNS devolution is set up the PC.

    Winsock API which MS ping will automatically use the FQDN of the client PC if append primary and connection specific DNS suffix is checked in TCP/IP advanced DNS settings. If the host is in another domain, the client must perform DNS devolution.

    Under XP TCP/IP advanced properties DNS, make sure append parent suffixes is checked so that the ping request traverses the domain back to the parent.

    0 讨论(0)
  • 2021-01-30 08:50

    I think the problem can be because of the NAT. Normally the DNS clients make requests via UDP. But when the DNS server is behind the NAT the UDP requests will not work.

    0 讨论(0)
  • 2021-01-30 08:51

    I know it's not your specific problem, but I faced the same symptoms when I configured a static IP address in the network adapter settings and forgot to enter a "Default Gateway".

    Leaving the field blank, the network icon shows an Internet connection, and I could ping internal servers but not external ones, so I assumed it was a DNS problem. NSLookup still worked, but of course, ping failed to find the server (again, seemed like a DNS issue.) Anyway, one more thing to check. =P

    0 讨论(0)
提交回复
热议问题