Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to ping my linux machines by host name and the pings are failing (can ping by ip just fine).

I then logged into the router which is the DNS server and see that the router sees the linux machines as "new-host1" "new-host2" etc...it's not getting their host names properly.

I can instead ping new-host1 successfully.

cat /etc/hostname

says the pc name is pc1

so why is the router seeing a diff name and how do i fix it? I rather not add the ip to the hosts file.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

If you don't have a DNS server that is aware of the hostnames of the linux machines, then there is no way for the DNS server to resolve the hostname to IP address.

It looks like your DNS server on the router will accept hostname registrations, so you can do the following.

On each of the debian linux boxes, edit:

/etc/dhcp/dhclient.conf

and add the line:

send host-name "hostname";

This will tell the DNS server the host name, and so it should add it to the local dns zone.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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