0

When I ping my Linux server (running in a VM on my Windows7 host) with the following command:

 ping -a 192.168.56.***

I get the results shown below. Why isn't it resolving my server's name?

Pinging 192.168.56.*** with 32 bytes of data:

Reply from 192.168.56.***: bytes=32 time<1ms TTL=64

Reply from 192.168.56.***: bytes=32 time<1ms TTL=64

Reply from 192.168.56.***: bytes=32 time<1ms TTL=64

Reply from 192.168.56.***: bytes=32 time<1ms TTL=64

where is the problem?

  • 2
    use nslookup to map from IP to name (provided your DNS server or /etc/hosts are up to date). Note however, there is no such thing as a "link" between IP and hostname. – Archemar Mar 12 '15 at 6:40
  • Are you pinging from a Windows client or a Linux client? (sorry I have to ask) The answer will allow us to help you better. – mdpc Mar 12 '15 at 6:53
  • i have not dns server, my linux server is a virtual machine in virtual box and i can not resolve it's name. – a avali Mar 12 '15 at 6:54
  • i ping my linux server with a win 7 client. as i mentioned my server is a virtual machine in virtual box – a avali Mar 12 '15 at 6:56
  • 2
2

The output looks perfectly normal.

Many (most?) ping implementations don't do reverse DNS lookup. If you pass an IP address, it displays an IP address.

After all, why would it bother with DNS? Pinging only requires the IP address. If you pass a host name, ping does a DNS lookup to get the address. If you pass an IP address, ping just uses the IP address.

If you want to perform a reverse DNS lookup, use a tool whose job it is to work with DNS, such as host 192.168.56.42 or nslookup 192.168.56.42. Note that in order for a machine to know another machine's name, it isn't enough to set the name in that machine's /etc/hosts: that won't let other machines know. The normal way to declare the name of a machine on Unix systems (like most of the world outside pre-Internet protocols) is to register it with DNS. Some VM software will automatically provide DNS services to virtual machines and serve names declared in /etc/hosts (or HOSTS.TXT on Windows) on the host. If yours doesn't, set up a DNS server (see this answer for a possible way).

There may be a way for Linux to support Windows's network discovery protocols (NetBIOS?) but I'm not familiar with that so I can't tell you how. If it can be made to work, you'll probably have to set up Samba on the Linux machine and configure it to advertise itself on the network (Windows tends to default wide open but Linux defaults discreet so you'll need to actively turn on name broadcasting).

0

there is no dns entry for that server in your dns zone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.