Discussion Locked

Linux Client to use Dynamic DNS

0 helpful
15 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi There,

I'm trying to get a Red Hat 7.3 machine to dynamically register itself in a DNS server. I'm using DHCP to get my IP Address, and the DNS Server is running on a Windows box. I know that the Windows DNS supports dynamic DNS (When the DHCPserver gives out an IP Address, it registers that computer with the DNS).

I get the IP Address for the machine correctly, and I can ping other computers on the network and can resolve thier names properly. Unfortunately, my own name is not registered with the DNS.

Following tips on the various forums, I've got the following network configuration setup.

The /etc/sysconfig/network looks like:
NETWORKING=yes
HOSTNAME=rower1
DHCP_HOSTNAME=rower1.testdomain.com

and network config file(/etc/sysconfig/network-scripts/ifcfg-eth0) has the following:
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
DHCP_HOSTNAME="rower1"

I've also tried setting the DHCP_HOSTNAME value to both rower1 and rower1.testdomain.com

Does anyone have any ideas on how to get things working?

Thanks.

Albert.

15 replies

by mledauphin

Take a look at the /etc/hosts file. Your hostname must be present.
That's all

Hope this will help you

by a fuchigami

The /etc/hosts file has the following entry:
127.0.0.1 localhost.localdomain localhost

I don't think changing this file is the answer, because then only the local computer will see the change. I want other machines on the network to be able to resolve the computer name to the correct entry - when means the DNS needs to get updated..

by alveden

Not sure whether the dns client in Redhat 7.3 distribution could be configure for dynamic updates. You need to have a dns client which have the capability of dynamic dns update. Check out the page below ... you can try those client. Haven't tried itwith windows 2000 dns before, but tried some of the client with bind.

http://www.linux.org/apps/all/Networking/DNS.html

by a fuchigami

People have been saying on the web that they've gotten RH7.3 working with DDNS. Didn't see anything on the web page you sugested that talked about configuring a Linux box to update a DNS Server dynamically.

by whw

This kinda side-steps the DNS question, but setting up Samba on the linux box should resolve your naming issue. Most windows clients check for the Netbios name first anyway

by whw

As another option, configure DHCP to assigning the Linux box a static ip and adding a manual entry to the DNS server. Just another option
HIH

by a fuchigami

I've got Samba running on the box, and it doesn't have anything to do with the name resolution. If the DNS doesn't know about the machine, you have to hook into Samba using the IP address.

I know that I can use a Static IP and hardcode the DNS, but I'm looking for a dynamic solution.

Thanks.

by whw

There are solutions for the linux-side of the house, but, I do not know how well (if?) they apply to cross-platform services. Will an MS DNS server accept input via nsupdate? maybe? maybe not? Are you able (willing?) to switch to Linux services? If not, then I'm not sure where the solution lies, although I would be interested in knowing the final resolution.

Related Links:

for BIND:
http://www.oceanwave.com/technical-resources/unix-admin/nsupdate.html

for DJBDNS:
http://www.thismetalsky.org/magic/projects/dhcp_dns.html

ALSO,
PLEASE NOTE THE FOLLOWING ADVISORIES

http://www.cert.org/advisories/CA-2003-01.html
http://www.cert.org/advisories/CA-2002-12.html

{Please remove extraneous spaces from the links above}

HIH

by paulo.sedrez

That depends on which DHCP client are you using. RH 7.3 provides two: pump and dhcpcd. Each one has the option to call a script each time the state of the lease and/or the interface changes: basically up (or renew), down (or release) and new (or change).

To dhcpcd, you have to create a script called /etc/dhcpc/dhccd.exe that will be called with the following parameters: HostInfoFilePath and State. HostInfoFilePath is the full path of a file with the parameters acquired by dhcpcd (shell variables format, quoted where necessary); the variable you want is IPADDR. This file's name is usually /etc/dhcpc/dhcpcd-.info; take a look to get more info. State is "up", "down" or "new": "up" to the same address, "down" to release it and "new" to a new one.

To pump, you have to create a configuration file, /etc/pump.conf, specifying the clause "script" with the full pathname of your script, which will accept the following parameters: State Interface [IP]. State is "up" for the granting of the lease, even if it was the same, "renewal" when the address is changed and "down" when it is released (in this case, the third argument is not provided). Interface is the interface name. IP is the IP number leased.

In the script, once you have your IP address, you can use nsupdate (provided with bind-9.x) to update your server. nsupdate will take commands from standard input or a file to update the master server - ONLY the master server - of a domain. In particular, you will use thefollowing commands, in this order: "server ", "update delete ". "update add IN A " and "send".

See the man pages of dhcpcd, pump and nsupdate for further details. I'll let the writting of the script as an exercice ;-)

--Sedrez

by a fuchigami

The nsupdate command did the trick. Now I just have to work out the script command to automatically update the DNS Server if the IP Address changes.

This discussion is closed to new replies.