User Tools

Site Tools


networking:linux:dnsmasq

This is an old revision of the document!


dnsmasq

Firewall

Disable the firewall on the server or open these ports:

  • open udp port 53 (DNS)
    • also open tcp port 53 if doing zone transfers
  • open udp port 67 (DHCP)
  • open udp port 6mkdir -p /var/lib/tftpboot

chmod 777 /var/lib/tftpboot cd /var/lib/tftpboot9 (TFTP)

  • open udp port 4011 (PXE)

Set the Server Hostname

vim /etc/hosts

127.0.0.1		localhost.localdomain localhost
::1			localhost6.localdomain6 localhost6 

192.168.2.2		sol.familycooper.org sol

Name Resolution

Set the server to use its own IP first:

vim /etc/resolv.conf

search familycooper.org
nameserver 127.0.0.1
nameserver 68.105.28.12
nameserver 68.105.29.12

Configure dnsmasq

mv /etc/dnsmasq.conf /etc/dnsmasq.conf.dist

vim /etc/dnsmasq.conf

# Add records to /etc/hosts file and restart dnsmasq for local name resolution.
#
# Hosts that use DHCP can also be resolved locally.
#
# Add 'nameserver 127.0.0.1' to /etc/resolv.conf ahead of other nameservers
# in order to resolve names on this (dnsmasq server) host.

#interface=eth0
domain-needed
bogus-priv
filterwin2k
strict-order

#Upstream Nameservers (if not gotten from DHCP)
# Cox 
#server=68.105.28.12
#server=68.105.29.12
# Google
server=8.8.8.8
server=8.8.4.4
expand-hosts
domain=familycooper.org
dhcp-range=192.168.2.65,192.168.2.199,24h

## DHCP Options
#
# 0.0.0.0 is 'self' (machine running dnsmasq)
#
dhcp-option=1,255.255.255.0 # subnet mask
dhcp-option=2,-25200 # time zone offset in seconds
dhcp-option=3,192.168.2.1 # default gateway
dhcp-option=6,0.0.0.0,68.105.28.12 # DNS servers (self and Cox NS1)
dhcp-option=7,0.0.0.0 # Log Server
dhcp-option=17,192.168.2.2:/opt/ltsp/i386 # BOOTP rootpath
dhcp-option=42,0.0.0.0 # NTP Server
dhcp-option=44,0.0.0.0 # set WINS
dhcp-option=66,"192.168.2.2" # TFTP server
dhcp-option=150,"sol.familycooper.org" # TFTP server address (Cisco?)

# Specify boot file and optionally the TFTP server
#
dhcp-boot=/ltsp/i386/pxelinux.0 # Specify boot file and optionally the TFTP server

# SRV Records for PBX
#
srv-host=_sip._tcp.familycooper.org,pbx.familycooper.org
srv-host=_sip._udp.familycooper.org,pbx.familycooper.org

## IP Lease Reservations
#
dhcp-host=08:00:27:fe:73:20,192.168.2.30,pbx
dhcp-host=00:0e:e9:02:cd:04,192.168.2.55,phone
dhcp-host=00:13:20:74:9b:a8,192.168.2.50,mars
dhcp-host=00:0e:08:ef:3d:11,192.168.2.56,ata

## TFTP Server
#
#enable-tftp # enable dnsmasq's built-in TFTP server
#tftp-root=/var/lib/tftpboot # set the TFTP root directory

Start dnsmasq Automatically

chkconfig dnsmasq on

service dnsmasq start

Polycom Phones

Allow Polycom phones to upload log files to TFTP server:

mkdir -p /var/lib/tftpboot
chmod 777 /var/lib/tftpboot
cd /var/lib/tftpboot
networking/linux/dnsmasq.1329433758.txt.gz · Last modified: 2012/02/16 16:09 by gcooper