Linux – Unable to ping Windows Server from Linux using hostname

linux

I have a virtual Windows 2008 domain controller with Dynamic IP and a CentOS box in the same network. I have created host record entries for the Linux server in both FLZ and RLZ on the Windows Server. However I cannot ping the Windows Server from the Linux Server using the Windows hostname.

I would prefer to ping the Windows Server by hostname without creating an entry for the Windows server under /etc/hosts file. Is there a way to do the same ?

Best Answer

Are you using the netbios name or the fully qualified domain name? If you want to use netbios names your going to need to specify a 'search domain' in your /etc/resolv.conf file. For example if you have a machine 'dev.example.org' and want to access it by just giving 'dev' you would need to add the following line to your /etc/resolv.conf file:

search example.org

You will also want to make sure that /etc/resolv.conf contains the correct DNS servers.