my newbie DDNS-HOWTO

darren teodarren at myrealbox.com
Thu Jan 23 22:24:40 SGT 2003


Ok...here goes:

These are the steps I took to make DDNS work on my little LAN (mostly
out of boredom and to kick my old windows habits).

Basically, I got a switch with 10 old computers (mixed windows, Linux)
connected to it but whose users like to disconnect and go to another LAN
sometimes. This LAN is then connected to the bigger LAN outside via one
of the 10 computers. I made this computer the Gateway, DNS and DHCP
server.

What is DDNS?

- Dynamic DNS, It's the stuff that makes your DHCP server talk to your
DNS server so that the former can update the latter without you having
to keepo static records with the DNS server.

Why do you need it?

- When you have a LAN worth of lazy people who roam in and out (both
wirelessly and physically) and you want them to have some "plug and
play" service to the network (eg. Print to "my_printer", retrieve mail
from "my_pop" etc. You can either have their MAC Addresses tied to the
DHCP server (via dhcpd.conf) and then implement a static DNS list, or
you can have dhcp give them dynamic addresses but updates the DNS
records every time it does that.

Background:
IP of gateway computer is 192.168.0.1 on eth1 (serving DHCP/DDNS on the
192.168.0.0)

Other IP of gateway computer is 192.168.1.150 (outside LAN is
192.168.1.0)

Gateway computer got RedHat7.3 installed.

The name of the zone I am creating is "mydomain.xxx" (you need a
domain/zone to group all your clients into to allow dns to search for
them in a systematic fashion)

Steps:
0) Read the man for dhcpd.conf and named.conf, and read the DNS-HowTo.
Then read http://ops.ietf.org/dns/dynupd/secure-ddns-howto.html

1) Upgrade your DHCP package to 3.0.x (as of time of writing) from
www.isc.org.

2) Create a /etc/dhcpd.conf file (use vi if you are cool...or kwrite if
you are a bum like me) with roughly the following entries:
************************************************************************
***
default-lease-time 86400;
max-lease-time 172800;
option routers 192.168.0.1;
option domain-name "mydomain.xxx";
option domain-name-servers 192.168.0.1;

ddns-domainname "mydomain.xxx";
ddns-update-style interim;
ignore client-updates;

include "/etc/rndc.key";
zone mydomain.xxx. {
	primary 127.0.0.1;
	key "rndckey";
}

zone 0.168.192.in-addr.arpa. {
	primary 127.0.0.1;
	key "rndckey";
}

subnet 192.168.0.0 netmask 255.255.255.0
{
	range 192.168.0.10 192.168.0.20;
}
************************************************************************
***
(I used the rndc.key file that came with redhat...make you own if you
are not comfortable)

3) Add two more entries to your /etc/named.conf:
************************************************************************
***
zone  "mydomain.xxx" {
	type master;
	file  "mydomain.xxx.zone";
	allow-update { key "rndckey"; };

zone  "0.168.192.in-addr.arpa" { 
	type master; 
	file  "0.168.192.in-addr.arpa.zone"; 
	allow-update { key "rndckey"; };
};
************************************************************************
***
4) Create /var/named/mydomain.xxx.zone with:
************************************************************************
***
$ORIGIN .
$TTL 86400	; 1 day
mydomain.xxx			IN SOA	network56.mydomain.xxx.
root.network56.mydomain.xxx. (
				90         ; serial
				28800      ; refresh (8 hours)
				7200       ; retry (2 hours)
				604800     ; expire (1 week)
				86400      ; minimum (1 day)
				)
			NS	network56.mydomain.xxx.
************************************************************************
***
5) Create /var/named/0.168.192.in-addr.arpa.zone with:
************************************************************************
***
$ORIGIN .
$TTL 86400	; 1 day
0.168.192.in-addr.arpa	IN SOA	0.168.192.in-addr.arpa.
root.localhost.0.168.192.in-addr.arpa. (
				62         ; serial
				28800      ; refresh (8 hours)
				7200       ; retry (2 hours)
				604800     ; expire (1 week)
				86400      ; minimum (1 day)
				)
			NS	network56.mydomain.xxx.
************************************************************************
***

6) Run "tail -f /var/log/messages" for a verbose view of the next few
process.

7) Start named with "service named start" and try "dig -x 127.0.0.1" to
see if your named is working (details in DNS howto).

8) Start dhcpd with "service dhcpd start".

9) Try getting a IP for one of your clients with "dhcpd eth0" (of cos
your client must be configured for DHCP first. Edit
/etc/sysconfig/network-script/ifcfg-ethx. Ifconfig to see if you got an
ip assigned.

10) Check if the DHCP works properly by ensuring that your client's
/etc/resolv.conf now got "search mydomain.xxx" and "nameserver
192.168.0.1".

11) At this point you should be seeing the DHCP update the DNS in the
shell console running "tail -f /var/log/messages" - step 6. At the same
time, you should also see your /var/named/ mydomain.xxx.zone and
/var/named/0.168.192.in-addr.arpa.zone get entries to them, like mine
becomes:
************************************************************************
***
$ORIGIN .
$TTL 86400	; 1 day
mydomain.xxx			IN SOA	network56.mydomain.xxx.
root.network56.mydomain.xxx. (
				90         ; serial
				28800      ; refresh (8 hours)
				7200       ; retry (2 hours)
				604800     ; expire (1 week)
				86400      ; minimum (1 day)
				)
			NS	network56.mydomain.xxx.
$ORIGIN mydomain.xxx.
bigmother		A	192.168.0.2
chasey			A	192.168.0.12
			TXT	"31019c07ec3e9939122f8df38c9699b937"
$TTL 300	; 5 minutes
dl360-01		A	192.168.0.10
			TXT	"311603286d4d1f116635151f72894f539a"
$TTL 3600	; 1 hour
jenna			A	192.168.0.11
			TXT	"3153ee7f01b6b93f66f6bd496b99ddef5d"
$TTL 86400	; 1 day
network56		A	192.168.0.1
************************************************************************
***

Try pinging the other clients by their names...if you get a reply from
say "client.mydomain.xxx"...great...you can now stop procrastinating and
get back to your real work before your boss comes around.

OK..thats all, I hope I did not miss out anything...

Darren


-----Original Message-----
From: Anand Vaidya [mailto:anandv at singnet.com.sg] 
Sent: Wednesday, January 22, 2003 9:27 PM
To: slugnet at lists.lugs.org.sg
Subject: Re: [slugnet] Dynamic DNS

Darren,

May be you could share your HOWTO with all of us? If it's OK with your
Co..

Rgds,
Anand

On Wednesday 22 January 2003 09:24 pm, darren wrote:
> Hi all,
>
> Got it all to work already...thanx! (there are lots of DDNS help on
> os.linux.networking, but I was searching for DHCP and DNS...wrong
> start!)
>
> The link http://ops.ietf.org/dns/dynupd/secure-ddns-howto.html pretty
> much summarises what the guys at the newsgroup are saying.
>
> Newbies (like me) setting up from a RedHat 7.3 distro, you will need
to
> upgrade your DHCP package to 3.0x first. Gte the latests from
> www.isc.org.
>
> There are lots of scripts and programs to do the same...but I would
> recommend using DHCP 3.0x and BIND 9.x.
>
> Thanx again everyone.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slugnet-unsubscribe at lists.lugs.org.sg
> For additional commands, e-mail: slugnet-help at lists.lugs.org.sg


---------------------------------------------------------------------
To unsubscribe, e-mail: slugnet-unsubscribe at lists.lugs.org.sg
For additional commands, e-mail: slugnet-help at lists.lugs.org.sg




More information about the Slugnet mailing list