Saturday, November 15, 2008

dnsmasq on xubuntu

11/15/08
install dnsmasq
$ sudo apt-get update
$ sudo apt-get install dnsmasq

DNS and DHCP are configured using the following files
/etc/hosts
/etc/dnsmasq.conf
/etc/resolv.conf
/etc/hostname

Edit /etc/hosts.

$ sudo cp /etc/hosts /etc/hosts_backup
$ sudo nano /etc/hosts

Add a line for each networked component or computer.
127.0.0.1 localhost
127.0.1.1 server
192.168.15.1 router
192.168.15.2 brett
192.168.15.3 tivo
192.168.15.4 wap
192.168.15.5 printer
192.168.15.6 server
#192.168.15.7 apple
#192.168.15.8 apple
192.168.15.9 entertainment
192.168.15.10 ddwrt
192.168.15.11 maxtor1
192.168.15.12 maxtor2
192.168.15.13 video

Edit /etc/dnsmasq.conf.

$ sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf_backup
$ sudo nano /etc/dnsmasq.conf

Uncomment and edit the following lines

expand-hosts
domain=mydomain.lan
dhcp-range=192.168.1.100,192.168.1.150,168h
dhcp-option=3,192.168.1.1

expand-hosts will automatically add .mydomain.lan to hostnames in /etc/hosts

dhcp-host=breeett,192.168.15.14

will always assign IP address 192.168.15.14 to the computer named breeett

/etc/resolve.conf on the dns/dhcp server should only contain the
external name servers. On my machine these are:
nameserver 66.75.160.63
nameserver 66.75.160.64

/etc/hostname should contain the hostname and domain. On my machine this is:
server.mydomain.lan

to verify the hostname is what you think it is, type
$ hostname
this will return the hostname without the domain. On my machine this is:
server

On the command line restart dnsmasq
$ sudo /etc/init.d/dnsmasq restart

tomorrow...
3dm2
Apache
PHP
Squirrelmail
Dokuwiki
power management (stop spinning hard drives)
fan speed control
netatalk

No comments: