DNS problem, nslookup works, ping doesn't

前端 未结 14 969
無奈伤痛
無奈伤痛 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

提交回复
热议问题