LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Can ping Ubuntu hosts but not Debian hosts by hostnames (https://www.linuxquestions.org/questions/linux-networking-3/can-ping-ubuntu-hosts-but-not-debian-hosts-by-hostnames-933429/)

garyozzy 03-08-2012 08:42 AM

Can ping Ubuntu hosts but not Debian hosts by hostnames
 
I have my router running dd-wrt doing dnsmasq for dns resolution.

I have two Ubuntu hosts and three Debian hosts.

All the hosts can ping each other by IP address.
All the hosts can ping the Ubuntu boxes by hostname.
No one (except the machine itself) can ping Debian hosts via hostnames.

I also have a box running Crux that I can't ping by hostname.

nslookup fails when trying ot find the Debian boxes.

Does anyone know why this could be?

Thanks!

acid_kewpie 03-08-2012 08:52 AM

the debian boxes presumably aren't providing their hostname in their dhcp request, whereas the ubuntu ones are.

Personally I would suggest not using this functionality in the first place. Configure dnsmasq to serve preconfigured data based on the clients MAC instead.

garyozzy 03-08-2012 09:04 AM

Quote:

Originally Posted by acid_kewpie (Post 4621849)
the debian boxes presumably aren't providing their hostname in their dhcp request, whereas the ubuntu ones are.

Personally I would suggest not using this functionality in the first place. Configure dnsmasq to serve preconfigured data based on the clients MAC instead.

How can I tell the debian boxes to provide their hostnames?

I would prefer to use this functionality, because they're all VMs that get created and deleted frequently in my lab environment.

acid_kewpie 03-08-2012 09:12 AM

I don't specifically know on debian. It depends what dhcp client it uses. I'd check which each system uses (dhcpcd, dhclient, pump etc...) and compare their respective config files. there's usually a flag that can be added to pass the data.

Skaperen 03-08-2012 10:30 PM

I've confirmed on my fresh install netbook, with Ubuntu 10.10, that this does pass the hostname to dnsmasq (which I don't usually use) running on my dd-wrt based router. So why does Debian not do this? I don't have a debian install to see. But what I can provide is the /etc/dhcp3/dhclient.conf from that machine for the OP to compare, or use as a config substitute to see if it might work (make a backup before substituting).

http://phil.ipal.org/lq/dhclient.conf

Code:

# Configuration file for /sbin/dhclient, which is included in Debian's
#        dhcp3-client package.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
#        man page for more information about the syntax of this file
#        and a more comprehensive list of the parameters understood by
#        dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
#        not leave anything out (like the domain name, for example), then
#        few changes must be made to this file, if any.
#

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name "<hostname>";
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,
        netbios-name-servers, netbios-scope, interface-mtu,
        rfc3442-classless-static-routes, ntp-servers;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/etc/dhcp3/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;

#alias {
#  interface "eth0";
#  fixed-address 192.5.5.213;
#  option subnet-mask 255.255.255.255;
#}

#lease {
#  interface "eth0";
#  fixed-address 192.33.137.200;
#  medium "link0 link1";
#  option host-name "andare.swiftmedia.com";
#  option subnet-mask 255.255.255.0;
#  option broadcast-address 192.33.137.255;
#  option routers 192.33.137.250;
#  option domain-name-servers 127.0.0.1;
#  renew 2 2000/1/12 00:00:01;
#  rebind 2 2000/1/12 00:00:01;
#  expire 2 2000/1/12 00:00:01;
#}


garyozzy 03-08-2012 10:36 PM

Uncommenting this line:
Code:

send host-name "<hostname>";
In debian's dhclient.conf does the trick, thanks everyone!

Skaperen 03-09-2012 10:32 AM

You can mark this thread SOLVED with an action in the Thread Tools drop down.


All times are GMT -5. The time now is 07:15 AM.