# Can't ping other computers on the same lan.

## StifflerStealth

I have the /etc/hosts and hostname filled out. I can look at the dhcp table for the DHCP, and all the computers are listed in the table. The other computers can ping my Gentoo box by typing in the name of it. I can ping the other computers if I use it's IP address. This may sound like a DNS problem, but I only have one nameserver, and I use it for the web which works great. IE type in www.gentoo.com, and it goes there. It's just not resolving the names for the computers on the lan.

Any Ideas on what can be the matter?

Thanks in advanced.

----------

## Naan Yaar

You need to add entries in your /etc/hosts file for machines you want to ping by name on your LAN.  Something like:

192.168.148.1   donner

192.168.148.2   blitzen

192.168.148.3   rudolph

I assume that your DNS server is to resolve external hosts.

 *StifflerStealth wrote:*   

> I have the /etc/hosts and hostname filled out. I can look at the dhcp table for the DHCP, and all the computers are listed in the table. The other computers can ping my Gentoo box by typing in the name of it. I can ping the other computers if I use it's IP address. This may sound like a DNS problem, but I only have one nameserver, and I use it for the web which works great. IE type in www.gentoo.com, and it goes there. It's just not resolving the names for the computers on the lan.
> 
> Any Ideas on what can be the matter?
> 
> Thanks in advanced.

 

----------

## StifflerStealth

 *Quote:*   

> You need to add entries in your /etc/hosts file for machines you want to ping by name on your LAN. Something like:
> 
> 192.168.148.1 donner
> 
> 192.168.148.2 blitzen
> ...

 

ok, is there any way to get a list of clients and their IP from the dhcp, so I don't need to hard code it? I already do that with my ip. I mean that I added lines in my /etc/init.d/net.eth0 file to get my Ip and put it in the hosts file. My IP does change that's why. It would be very helpful if I could read a the names and IPs in the DHCP and add them to /etc/hosts

Thanks for the quik reply.

----------

## Naan Yaar

Is the DHCP server for your internal network?  You can use something called dynamic dns (i.e., dns that accepts updates from DHCP).  You can search google to find resources related to this.

Good luck.

[quote="StifflerStealth"] *Quote:*   

> ...
> 
> ok, is there any way to get a list of clients and their IP from the dhcp, so I don't need to hard code it? I already do that with my ip. I mean that I added lines in my /etc/init.d/net.eth0 file to get my Ip and put it in the hosts file. My IP does change that's why. It would be very helpful if I could read a the names and IPs in the DHCP and add them to /etc/hosts
> 
> Thanks for the quik reply.

 

----------

## StifflerStealth

I did a search for dynamic dns on this forum, natuallythere is nothing on it. Well off to google to find answers. If anyone wants to help in the search, I could use all the help I can get. I am still new to linux.

Thanks for all your help.

----------

## Naan Yaar

Are you sure you want to run a dns server?  How big is your internal network?  Can you statically assign addresses?  It may save you a lot of hassles.

 *StifflerStealth wrote:*   

> I did a search for dynamic dns on this forum, natuallythere is nothing on it. Well off to google to find answers. If anyone wants to help in the search, I could use all the help I can get. I am still new to linux.
> 
> Thanks for all your help.

 

----------

## meyerm

And if you're only using a few computers you could "hardcode" their IPs combined with their MACs into DHCP. Then a /etc/hosts would always be correct for these computers.

----------

## StifflerStealth

There are roughly 2000 computers on the network, and I do not want to add each computer to the /etc/hosts file so I can ping them or use their name in the weburl or whatever. That is why I need something that can read a list of computers in the dhcp table and update my list so I can use thier names. I don't want to set up a dns server to do that because the network already has one, and I'm just a client.

----------

## Nitro

 *StifflerStealth wrote:*   

> I did a search for dynamic dns on this forum, natuallythere is nothing on it. Well off to google to find answers. If anyone wants to help in the search, I could use all the help I can get. I am still new to linux.

 

Answers maybe be a little closer then you think, take a peek in /usr/share/doc/bind-9.2.1-r1/dhcp-dynamic-dns-examples/bind/

Contains configs for both bind and dhcpd.

----------

## StifflerStealth

 *Quote:*   

> Answers maybe be a little closer then you think, take a peek in /usr/share/doc/bind-9.2.1-r1/dhcp-dynamic-dns- examples/bind/
> 
> Contains configs for both bind and dhcpd.

 

But does this method require you to setup a dns server?

----------

## Naan Yaar

Is your DHCP server a windows box?  Were you using something like dhcpcmd.exe to dump dhcpd status?

----------

## StifflerStealth

I believe it's a Sun Solaris machine, but don't remember correctly. They are using bind as the dns server. I don't remember what is used as the dhcp server.

----------

