LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-08-2010, 07:06 AM   #1
stryker_oz
LQ Newbie
 
Registered: Mar 2005
Location: Brisvegas, Australia
Distribution: Fedora 15 & 17, Raspbian & openELEC
Posts: 26

Rep: Reputation: 15
How to check DHCP_HOSTNAME is being sent/used ?


Hi,

I've recently installed FC12 and would like to leave this PC setup to grab an IP via DHCP. I use BackupPC so it needs to have a dhcp_hostname set so the machine can be located for backing up, and all that appears right however BackupPC can't find it.

When I run Angry IP Scanner, the hostname shows as N/A. Is this possibly a function of SELinux? In contrast, my FC11 box shows a hostname but I don't run SELinux on it.

How can I check for certain that the machine is submitting its hostname when it requests an IP?

Thanks
 
Old 03-08-2010, 09:06 AM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Look at the command line options used for dhcp.
Code:
#ps -ef | grep dhcp

root      3226     1  0 08:56 ?        00:00:00 /sbin/dhcpcd -t 10 -h animal eth0
You if the -h <hostname> is present, then hdcpcd is sending the hostname, but that does not necessary meant that it is not. See the -h option entry in the man page below:
Quote:
-h, --hostname hostname
By default, dhcpcd will send the current hostname to the DHCP
server so it can register in DNS. You can use this option to
specify the hostname sent, or an empty string to stop any
hostname from being sent.
 
1 members found this post helpful.
Old 03-09-2010, 02:38 AM   #3
stryker_oz
LQ Newbie
 
Registered: Mar 2005
Location: Brisvegas, Australia
Distribution: Fedora 15 & 17, Raspbian & openELEC
Posts: 26

Original Poster
Rep: Reputation: 15
Question It is providing the hostname, but still doesn't advertise them on the network

Thanks for the tip, crabboy. It got me aimed in the right direction, but still puzzled. Firstly, the result of that grep showed a completely different process running
Code:
root      2546  1228  0 18:15 ?        00:00:00 /sbin/dhclient -d -sf /usr/libexec/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhclient/dhclient-47350821-f9cf-478f-8421-0e9cda61ba5b-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0
root      2641  2010  0 18:27 pts/0    00:00:00 grep dhcp
But I ran that same query on my DHCP server and it does run it. Then when I cat'd dhcpd.leases it proved that the hostname and the MAC address are being set correctly.

Incidentally, the result of arp --all on the same box shows the correct MAC at the IP to identify the FC12 box, but no hostname (same result for that IP on my FC11 box). I'm not sure if that's significant.

So...why doesn't the FC12 box advertise its Hostname, Comp Name or MAC address when probed? Is it something in SELinux? I've had a scout through the booleans and can't see anything that fits the bill...yet.

Thanks again !

Last edited by stryker_oz; 03-09-2010 at 04:13 AM.
 
Old 03-09-2010, 08:39 AM   #4
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Have you read the Dynamic DNS section of the dhclient.conf man page? It has about a page worth of info regarding updating the DNS. It sounds like you do have control over your DNS, so you may be in luck. All our RH boxes I found in our shop have static IPs, so I can't play around with the dhclient config. The example I sent you before,using dhcpcd, was from a slack box.

Just the first part:
Code:
DYNAMIC DNS
       The client now has some very limited support for doing DNS updates when
       a  lease  is  acquired.   This is prototypical, and probably doesn't do
       what you want.   It also only works if you happen to have control  over
       your DNS server, which isn't very likely.
 
Old 03-10-2010, 05:40 AM   #5
stryker_oz
LQ Newbie
 
Registered: Mar 2005
Location: Brisvegas, Australia
Distribution: Fedora 15 & 17, Raspbian & openELEC
Posts: 26

Original Poster
Rep: Reputation: 15
Smile Inching closer to a resolution...maybe

Hi,

Thanks again for another great suggestion. I'm starting to think chasing a DNS was maybe a red herring since we are talking about a machine on our local LAN rather than one that's broadcasting to the world. Therefore dynamic DNS also won't be the answer.

I've confirmed the DHCP server is receiving the hostname and MAC address correctly (it's written into the logs and the leases file) of the DHCP server. Today I've enabled WINS resolution through SMB and NMB on the FC12 box and I can browse my network from XP and see the FC12 box is there.

Strangely, the Angry scanner doesn't see the workgroup name though. It's still like this FC12 machine is keeping everything to itself!

The result of /usr/bin/nmblookup -A xxx.xxx.xxx.xxx correctly finds the hostname. Use the machine hostname rather than its IP and it won't find it of course (and that's how BackupPC does it).

Unfortunately the machines being backed up by BackupPC with DHCP are all Windoze of various flavors so I don't have a prototype to check, only confirmation it is possible. The other Linux boxes being backed up are static...I was hoping not to have to do that, but it might have to be my fallback position for expediency.

I welcome any thoughts or suggestions...thanx
 
Old 03-10-2010, 08:13 AM   #6
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
What type of DNS and dhcp servers do you have? Windows?

Our network at work is fairly UNIX hostile, we have Windows AD servers and Win DNS. The DNS has never worked with the Linux or AIX machines. We get around it by either creating static leases in the DHCP or static IPs and put static entries in the DNS. The Windows admins don't care enough to get this working correctly.
 
Old 03-10-2010, 04:55 PM   #7
stryker_oz
LQ Newbie
 
Registered: Mar 2005
Location: Brisvegas, Australia
Distribution: Fedora 15 & 17, Raspbian & openELEC
Posts: 26

Original Poster
Rep: Reputation: 15
Thumbs up DHCP and DNS

HI again

DHCP is provided by a smoothwall (linux derivative) firewall which also runs a DNS proxy. When I looked further into DNS I had thought smoothwall provided that too, but it's actually only a DNS cache so I'm uncertain it gives the functionality I presumed.

After finding that I was considering setting up one of the linux boxes to provide DNS (one that is the master WINS name server via SAMBA)...but after consideration I'm now thinking going to static on this client might be the simple, faster, if less elegant way to go since there's only one.

It does bug me the windows clients do this seemingly by default and yet I've not been able to find out a reason for what looks like a perfectly healthy and well behaved FC12 box not...but this mystery might have to remain unsolved, at least for now.

Thanx for your helpful suggestions! I'll post if I find the answer in future.

Last edited by stryker_oz; 03-10-2010 at 04:56 PM.
 
  


Reply

Tags
dhcp, fedora, hostname, selinux



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
tcp/ip buffer, how to check check actual size japotemp Linux - Newbie 2 01-23-2009 06:17 AM
Health Check / Server Completion Check Software? tells Linux - Enterprise 0 04-20-2006 11:03 AM
Partition check, check double check Vincentius Linux - General 0 12-25-2004 05:47 AM
dhcp_hostname in Debian Woody R1 where? Mrcdm Debian 2 07-02-2004 06:25 PM
Boot disk; check. CD in drive; check. Doesn't work; check. Hal DamnSmallLinux 7 02-04-2004 02:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 05:42 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