[vox-tech] HOWTO: setup private DNS/DHCP server...

Mike Simons vox-tech@lists.lugod.org
Tue, 29 Apr 2003 02:17:36 -0400


--f5QefDQHtn8hx44O
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

  Glad to hear you got NFS working.

On Mon, Apr 28, 2003 at 07:55:28PM -0700, Richard S. Crawford wrote:
> Next up: DNS, I think.  I shouldn't have to refer to other computers in
> my network by their IP addresses.

  Very basic, multiple ways to do this... in this everything is static
controlled by the dhcp server, one big mac address to name lookup table.
Some sort of dynamic dhcp-dns update might be better, but is out of scope=
=20
for this email.

    Good Luck,
      Mike Simons

Disclaimer:
  I use settings like these on three different networks but this example
  is not verbatim from any of them so there might be some errors...


Step one: Need DHCP server working on some machine

/etc/dhcpd.conf
=3D=3D=3D=3D
# dhcpd.conf

option domain-name "chaos";
option domain-name-servers 10.10.16.1;

option subnet-mask 255.255.255.0;
default-lease-time 3600;
max-lease-time 72000;

subnet 10.10.16.0 netmask 255.255.255.0 {
  range 10.10.16.16 10.10.16.254;
  option broadcast-address 10.10.16.255;
  option routers 10.10.16.1;
}

host mordor {
  hardware ethernet 08:00:07:26:c0:a5;
  fixed-address mordor.chaos;
}

# repeat one of the host blocks for each static machine on your net,
# fix the ethernet address as required.
=3D=3D=3D=3D


Step two: DNS server working on some machine=20
          (referred to by "domain-name-servers" above)


/etc/bind/db.chaos=20
=3D=3D=3D=3D
; BIND data file for local chaos network
$TTL    86400
@       IN      SOA     chaos. root.chaos. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                          86400 )       ; Negative Cache TTL
;
@       IN      NS      chaos.
localhost       IN      A       127.0.0.1
moria           IN      A       10.10.16.1     =20
gondor          IN      A       10.10.16.2     =20
rohan           IN      A       10.10.16.3     =20
mordor          IN      A       10.10.16.4     =20
lorien          IN      A       10.10.16.5     =20
shire           IN      A       10.10.16.6     =20
mirkwood        IN      A       10.10.16.7     =20
printer         IN      A       10.10.16.8     =20
=3D=3D=3D=3D

/etc/bind/db.10
=3D=3D=3D=3D
; BIND reverse data file for broadcast zone
$TTL    86400
@       IN      SOA     chaos. root.chaos. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                          86400 )       ; Negative Cache TTL
;
@       IN      NS      localhost.
1       IN      PTR     moria.chaos.
2       IN      PTR     gondor.chaos.
3       IN      PTR     rohan.chaos.
4       IN      PTR     mordor.chaos.
5       IN      PTR     lorien.chaos.
6       IN      PTR     shire.chaos.
7       IN      PTR     mirkwood.chaos.
8       IN      PTR     printer.chaos.
=3D=3D=3D=3D

Add to /etc/bind/named.conf
=3D=3D=3D=3D
zone "chaos" {
        type master;
        file "/etc/bind/db.chaos";
};

zone "16.10.10.in-addr.arpa" {
        type master;
        file "/etc/bind/db.10";
};
=3D=3D=3D=3D


Step three: Optional
            If you want the clients to resolve other domain names as well,=
=20
            the client machines can replace the dhcpd instruction.

/etc/dhclient.conf
=3D=3D=3D=3D
# /etc/dhclient.conf for dhcp-client package.
supersede domain-name "lugod.org foo.bar chaos";
=3D=3D=3D=3D

--=20
GPG key: http://simons-clan.com/~msimons/gpg/msimons.asc
Fingerprint: 524D A726 77CB 62C9 4D56  8109 E10C 249F B7FA ACBE

--f5QefDQHtn8hx44O
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+rhkA4Qwkn7f6rL4RAhQEAJ99aqUuJVwWh/kHUrSyMkHUPuc/pwCfdrOS
BBIh9XNotqAE0xj2dAAVW4g=
=FIgu
-----END PGP SIGNATURE-----

--f5QefDQHtn8hx44O--