[SOLVED] How to ping Windows 7 machines by name from Debian Server?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Desktop - Ubuntu, Server - Debian, CentOS
Posts: 72
Rep:
How to ping Windows 7 machines by name from Debian Server?
I have backuppc installed on my Debian server and I need to be able to resolve my Windows 7 machines on my home LAN by name. I have a machine called lanthanum, and if I ping it by name I get this:
Code:
PING lanthanum (67.215.65.132) 56(84) bytes of data.
64 bytes from hit-nxdomain.opendns.com (67.215.65.132): icmp_req=1 ttl=55 time=247 ms
Why is ping going out to the internet? Lanthanum's IP address is 10.0.0.57 and it should resolve to that but it's not. I can ping lanthanum fine from windows machines. I've added "wins" to /etc/nsswitch.conf on the "hosts:" line and rebooted, but it's still not working. I have a DNS server on my home network. Any ideas? I don't want to configure the hosts file.
Try using the "Fully Qualified Domain Name" (FQDN) of the Windows machine in question.
You should be able to undo the change to your nsswitch.conf file as well.
EDIT: If you do an 'nslookup lanthanum', and you're not "hitting" your local LAN first, your *NIX system's /etc/resolv.conf may need to be tweaked.
What does the "hosts" line in /etc/nsswitch.conf have in it other than wins? If you have DNS it seems you could set line to have dns and hosts. I've never used wins in nsswitch.conf so don't know if it should work and/or if it requires additional configuration (e.g. samba for user authorization) to work.
When you type a host name by default it will try whatever method is in nsswitch.conf first then the next one second then the last one so for example I typically have:
hosts: files dns
which tells it to look at /etc/hosts first then dns. (This allows me to override DNS entries at host level by specifying the host in /etc/hosts.)
A default example is:
hosts: db files nisplus nis dns
That would first look at a database, then at /etc/hosts then at nisplus then at nis and finally at dns to find the name.
The name you typed is the "short" name. The /etc/resolv.conf can tell DNS what domain to search as well as what DNS server to query. You probably got the internet default answer because either you have a domain to search specified that it found or you don't have any and it made its guess on what to look for based on whatever the stub resolver on Linux is designed to use by default. If the fully qualified domain name (FQDN) is something like: lanthanum.myexample.com then you'd add myexample.com as the search domain to resolv.conf so that when you did the DNS lookup for the short name it would know to try appending myexample.com to get the FQDN.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.