LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-23-2009, 09:17 AM   #1
davidshen84
LQ Newbie
 
Registered: Feb 2009
Posts: 8

Rep: Reputation: 0
Smile why I cannot ping my machines in my LAN with hostname?


Hi,

I have a linux server in my LAN. After this server is startup, I can see in my route configure page, that it is registered with the hostname 'mylinux', which is correct. On another machine which runs windows, it cannot ping my linux server with its hostname. On my linux server, it cannot ping any machine in my LAN with their hostname, but it can ping host that is on the Internet. Ex:
ping MyBoxInLan # it reports host unknown
ping www.linuxquestions.org # works alright.

I use dhcpd on my linux server to register it in my LAN. In the /etc/resolve.conf file, it says:
nameserver IP1.Of.MyISP
nameserver IP2.Of.MyISP

I tried to append the IP of my LAN's route at last, and restart dhcpd, but it won't solve my problem.

So, I come here to look for help. Thanks
 
Old 02-23-2009, 10:10 AM   #2
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
Edit /etc/nsswitch.conf and change the line that looks like: hosts: files dns to hosts: files dns wins.Post if that's all that you need.
Quote:
Each computer running Windows has a NetBIOS name; you can view/change it on the identification tab in Control Panel -> Network. Various services & client tools, including Network Neighborhood and NET USE, use NetBIOS names. The NetBIOS name is specified when Windows networking is installed/configured. In order to connect to a computer running TCP/IP via its NetBIOS name, the name must be resolved to an IP Address (the NetBIOS name-IP address resolution is often done by WINS - NetBIOS Name Server). A computer's NetBIOS name is often the same as that computer's host name (see below), but it doesn't have to be.A Windows machine's NetBIOS name is not to be confused with the computer's host name. Each computer running TCP/IP (whether it's a Windows machine or not) has a host name (also sometimes called a machine name). You can view/change it on the DNS tab in Control Panel -> Network -> TCP/IP -> Properties Host names are used by applications such as telnet, ftp, web browsers, etc. In order to connect to a computer running the TCP/IP protocol using its HOST name, the host name must be resolved into an IP Address (the host name or FQDN (Fully Qualified Domain Name)-IP address resolution is typically done by something called DNS - Domain Name System/Service). Changing a computer's Host name DOES NOT change its NetBIOS name.
 
Old 02-23-2009, 10:42 AM   #3
gergely89
Member
 
Registered: Feb 2009
Posts: 100

Rep: Reputation: 21
You should add your list of hostnames to each /etc/hosts file on Linuxes - on Windows theres is also a hosts file somewhere with similar intent. Without linking an IP to a hostname a system has no way to guess where to look, unless you maintain your own DNS service and have added each of the hostnames to your DNS configuration. It is not clear from your post if have those hostnames in your DNS - if so, then maybe some error slipped in there.

linux

Last edited by gergely89; 02-27-2009 at 11:47 PM.
 
Old 02-23-2009, 11:48 AM   #4
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

Rep: Reputation: 148Reputation: 148
I dont think your ISP DNS resolve your LAN hostname so you will have to configure local DNS or
As "gergely89" mentioned you can solve this problem

For Linux
vi /etc/hosts
172.16.11.1 host1.domain.com
172.16.11.2 host2.domain.com
like this....

For Windows
C:\WINDOWS\system32\drivers\etc\hosts
ipaddress1 hostname.domain.com
ipaddress2 hostname.domain.com
like this....
 
Old 02-25-2009, 07:51 AM   #5
davidshen84
LQ Newbie
 
Registered: Feb 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kirukan View Post
I dont think your ISP DNS resolve your LAN hostname so you will have to configure local DNS or
As "gergely89" mentioned you can solve this problem

For Linux
vi /etc/hosts
172.16.11.1 host1.domain.com
172.16.11.2 host2.domain.com
like this....

For Windows
C:\WINDOWS\system32\drivers\etc\hosts
ipaddress1 hostname.domain.com
ipaddress2 hostname.domain.com
like this....
of course, my ISP cannot resolve my machines in my LAN. But windows uses WINS to resolve the machine's in a LAN, just as alan_ri suggested. Unfortunately, adding 'wins' to my /etc/nsswitch.conf does now work.

I have been searching the web for a while, but none of the solutions solves my problems...

I am using Gentoo Linux 2008. Not sure if this problem only exist on this distribution.
 
Old 02-25-2009, 09:56 AM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
user@it-lenny:~$ apropos netbios
lmhosts (5) - The Samba NetBIOS hosts file
nmbd (8) - NetBIOS name server to provide NetBIOS over IP naming services to clients
nmblookup (1) - NetBIOS over TCP/IP client used to lookup NetBIOS names


Might want to look at those..
 
Old 02-25-2009, 11:40 AM   #7
pentode
Member
 
Registered: Dec 2005
Location: Oregon
Distribution: Debian Testing
Posts: 488

Rep: Reputation: 38
Post the contents of your nsswitch.conf file. wins will not work if you don't have a WINS server. Samba can do that for you.

The hosts file will work if you have fixed IP addresses. I believe the Windows fallback is still broadcast mode, but you'll need to have that in your nsswitch.conf I think.

I had this issue, but we are running a samba server so I just turned on WINS server in samba, added wins to the nsswitch.conf options and all was well.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to ping fom hostname between two RHEL5 virtual machines raj_hcl1986@rediffma Linux - Newbie 2 10-30-2008 07:44 PM
linux router unable to ping itself or other machines on the LAN cyberfishee Linux - Networking 12 05-31-2007 07:27 PM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 05:57 AM
Ping a computer in LAN using hostname seven Linux - Networking 3 07-05-2003 11:42 PM
Can't ping windows machines by hostname explorer Linux - Networking 10 03-06-2003 01:44 PM


All times are GMT -5. The time now is 01:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration