LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-08-2012, 08:42 AM   #1
garyozzy
Member
 
Registered: Jun 2005
Distribution: RHEL, CentOS, Debian, Ubuntu, Arch
Posts: 181

Rep: Reputation: 30
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!
 
Old 03-08-2012, 08:52 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 03-08-2012, 09:04 AM   #3
garyozzy
Member
 
Registered: Jun 2005
Distribution: RHEL, CentOS, Debian, Ubuntu, Arch
Posts: 181

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie View Post
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.
 
Old 03-08-2012, 09:12 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 03-08-2012, 10:30 PM   #5
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,678
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
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;
#}
 
Old 03-08-2012, 10:36 PM   #6
garyozzy
Member
 
Registered: Jun 2005
Distribution: RHEL, CentOS, Debian, Ubuntu, Arch
Posts: 181

Original Poster
Rep: Reputation: 30
Uncommenting this line:
Code:
send host-name "<hostname>";
In debian's dhclient.conf does the trick, thanks everyone!
 
Old 03-09-2012, 10:32 AM   #7
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,678
Blog Entries: 31

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


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
compare the hostnames in /etc/hosts with the result of nslookup on a ip from /etc/hos pete83 AIX 3 12-18-2007 03:34 AM
can't ping local IP address but can ping remote hosts rob_xx17 Linux - Networking 4 12-02-2006 08:39 AM
hosts file reverses IP and hostnames mike114327 Linux - Networking 0 10-12-2004 02:13 PM
dhcp client can't ping gateway but can ping other local hosts dirty_forks Linux - Networking 7 10-08-2004 10:54 AM
Is There a ~/.hosts ? or anything in user level to aliasing hostnames ? cartridge Linux - Networking 2 01-12-2004 12:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:40 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
Open Source Consulting | Domain Registration