[Gllug] DHCP & DNS

Pete Ryland pdr at pdr.cx
Thu Dec 6 11:34:20 UTC 2001


On Thu, Dec 06, 2001 at 11:10:02AM +0100, Jonathan Dye wrote:
> At 10:51 06/12/01 +0000, you wrote:
> >If your linux box is a workstation I'm presuming you are using dns and dhcp
> >under w2k.
> Nope, server is linux.  I want to plug in both linux and windows clients to
> the network and have the dns entries updated.

Yeah, it's possible as Bruce has already mentioned.  I had (have) this set
up at my last house.  It was a pain to set up iirc, requiring updates to
both the dhcpd and dns packages - however the latest versions in your distro
of choice may be enough now.  Anyway, here's the (ISC) dhcpd.conf I used:

default-lease-time 86400;
max-lease-time 604800;
ddns-update-style ad-hoc;  # if this line causes problems, update dhcpd.
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.150 192.168.0.160;
  option domain-name-servers 192.168.0.7, 203.2.193.124, 203.2.192.124, 203.111.28.31;
  option domain-name "lodge.dodgy.as";
  option routers 192.168.0.7;
  option broadcast-address 192.168.0.255;
  default-lease-time 86400;
  max-lease-time 604800;
}

And the named.conf includes the following zones:

zone "0.168.192.in-addr.arpa" IN {
        notify no;
        type master;
        file "192.168.0";
        allow-update { 127.0.0.1; 192.168.0/24; 192.168.0.1; };
};

zone "lodge.dodgy.as" IN {
        notify no;
        type master;
        file "lodge.dodgy.as";
        allow-update { 127.0.0.1; 192.168.0/24; 192.168.0.1; };
};

Hmm.. don't know what the 192.168.0.1 is doing in the allow-update line - I
don't think it's necessary, but anyway...

Um, the the actual zone files should look something like:

;BIND DUMP V8
$ORIGIN 168.192.in-addr.arpa.
0       86400   IN      SOA     ns.lodge.dodgy.as. root.alf.lodge.dodgy.as.
 (
                2001031476 28800 7200 604800 86400 )    ;Cl=5
        86400   IN      NS      ns.lodge.dodgy.as.      ;Cl=5
$ORIGIN 0.168.192.in-addr.arpa.
243     1200    IN      PTR     combi.lodge.dodgy.as.   ;Cl=5
67      86400   IN      PTR     sledge.lodge.dodgy.as.  ;Cl=5
7       86400   IN      PTR     alf.lodge.dodgy.as.     ;Cl=5
68      86400   IN      PTR     yakka.lodge.dodgy.as.   ;Cl=5
42      86400   IN      PTR     melinda.lodge.dodgy.as. ;Cl=5
69      86400   IN      PTR     dogger.lodge.dodgy.as.  ;Cl=5
9       86400   IN      PTR     muriel.lodge.dodgy.as.  ;Cl=5
132     86400   IN      PTR     pocky.lodge.dodgy.as.   ;Cl=5

and for the forward zone file:

;BIND DUMP V8
$ORIGIN dodgy.as.
lodge   86400   IN      SOA     ns.lodge.dodgy.as. root.alf.lodge.dodgy.as.
 (
                2001041007 28800 7200 604800 86400 )    ;Cl=3
        86400   IN      TXT     "Our bit of Stu's domain."      ;Cl=3
        86400   IN      NS      alf.lodge.dodgy.as.     ;Cl=3
        86400   IN      A       192.168.0.7     ;Cl=3
        86400   IN      MX      1 mail.lodge.dodgy.as.  ;Cl=3
        86400   IN      HINFO   "alpha" "Linux" ;Cl=3
$ORIGIN lodge.dodgy.as.
alf     86400   IN      A       192.168.0.7     ;Cl=3
        86400   IN      MX      1 mail.lodge.dodgy.as.  ;Cl=3
        86400   IN      HINFO   "alpha" "Linux" ;Cl=3
combi   1200    IN      A       192.168.0.243   ;Cl=3
muriel  86400   IN      A       192.168.0.9     ;Cl=3
        86400   IN      MX      1 mail.lodge.dodgy.as.  ;Cl=3
        86400   IN      HINFO   "x86" "Linux"   ;Cl=3
[snip...]

As you can see, most of the machines still use static ips (there's a common
/etc/hosts file which is much quicker than dns), but we have visitors at
times who use the dhcp thing.

Hope this helps,
Pete

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list