User Tools

Site Tools


networking:linux:dnsmasq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
networking:linux:dnsmasq [2012/02/16 16:06]
gcooper created
networking:linux:dnsmasq [2015/12/17 20:08] (current)
gcooper
Line 19: Line 19:
 Disable the firewall on the server or open these ports: Disable the firewall on the server or open these ports:
  
-  * open udp port 53 (DNS) +  * Open UDP port 53 (DNS) 
-    * also open tcp port 53 if doing zone transfers +    * Also open TCP port 53 if doing zone transfers 
-  * open udp port 67 (DHCP) +  * Open UDP port 67 (DHCP) 
-  * open udp port 69 (TFTP) +  * Open UDP port 69 (TFTP) 
-  * open udp port 4011 (PXE)+  * Open UDP port 4011 (PXE)
  
 ===== Set the Server Hostname ===== ===== Set the Server Hostname =====
 +
 +Adjust as necessary.
  
 <file> <file>
Line 33: Line 35:
 ::1 localhost6.localdomain6 localhost6  ::1 localhost6.localdomain6 localhost6 
  
-192.168.2.2 sol.familycooper.org sol+192.168.1.2 hostname.domain.tld hostname
 </file> </file>
  
Line 43: Line 45:
 vim /etc/resolv.conf vim /etc/resolv.conf
  
-search familycooper.org+search domain.tld
 nameserver 127.0.0.1 nameserver 127.0.0.1
-nameserver 68.105.28.12 +nameserver 8.8.8.8 
-nameserver 68.105.29.12+nameserver 8.8.4.4
 </file> </file>
  
 ===== Configure dnsmasq ===== ===== Configure dnsmasq =====
 +
 +This is a sample config file and absoultely must be adapted for your network.
  
 <file> <file>
Line 56: Line 60:
 vim /etc/dnsmasq.conf vim /etc/dnsmasq.conf
  
-#add records to /etc/hosts file and restart dnsmasq for local name resolution +Add records to /etc/hosts file and restart dnsmasq for local name resolution. 
- +# 
-#hosts that use DHCP can also be resolved locally +Hosts that use DHCP can also be resolved locally. 
- +# 
-#add 'nameserver 127.0.0.1' to /etc/resolv.conf ahead of other nameservers +Add 'nameserver 127.0.0.1' to /etc/resolv.conf ahead of other nameservers 
-#in order to resolve names on this (dnsmasq server) host+# in order to resolve names on this (dnsmasq server) host.
  
 #interface=eth0 #interface=eth0
Line 69: Line 73:
 strict-order strict-order
  
-#Upstream Nameservers (if not gotten from DHCP) +# Upstream Nameservers (if not gotten from DHCP) 
-# Cox +# 
 +# Cox Name Servers 
 #server=68.105.28.12 #server=68.105.28.12
 #server=68.105.29.12 #server=68.105.29.12
-# Google+
 +# Google Name Servers
 server=8.8.8.8 server=8.8.8.8
 server=8.8.4.4 server=8.8.4.4
 expand-hosts expand-hosts
-domain=familycooper.org +domain=domain.tld 
-dhcp-range=192.168.2.65,192.168.2.199,24h+dhcp-range=192.168.1.65,192.168.1.199,24h
  
 ## DHCP Options ## DHCP Options
Line 84: Line 90:
 # 0.0.0.0 is 'self' (machine running dnsmasq) # 0.0.0.0 is 'self' (machine running dnsmasq)
 # #
-dhcp-option=1,255.255.255.0 # subnet mask +dhcp-option=1,255.255.255.0                  # subnet mask 
-dhcp-option=2,-25200 # time zone offset in seconds +dhcp-option=2,-25200                         # time zone offset in seconds 
-dhcp-option=3,192.168.2.1 # default gateway +dhcp-option=3,192.168.1.1                    # default gateway 
-dhcp-option=6,0.0.0.0,68.105.28.12 # DNS servers (self and Cox NS1+dhcp-option=6,0.0.0.0,8.8.8.8                # DNS servers (self and Google
-dhcp-option=7,0.0.0.0 # Log Server +dhcp-option=7,0.0.0.0                        # Log Server 
-dhcp-option=17,192.168.2.2:/opt/ltsp/i386 # BOOTP rootpath +dhcp-option=17,192.168.1.2:/tftpboot         # BOOTP rootpath 
-dhcp-option=42,0.0.0.0 # NTP Server +dhcp-option=42,0.0.0.0                       # NTP Server 
-dhcp-option=44,0.0.0.0 # set WINS +dhcp-option=44,0.0.0.0                       # set WINS 
-dhcp-option=66,"192.168.2.2" # TFTP server +dhcp-option=66,"192.168.1.2"                 # TFTP server 
-dhcp-option=150,"sol.familycooper.org" # TFTP server address (Cisco?) +dhcp-option=150,"hostname.domain.tld       # 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 Records for PBX
 # #
-srv-host=_sip._tcp.familycooper.org,pbx.familycooper.org +srv-host=_sip._tcp.domain.tld,hostname.domain.tld 
-srv-host=_sip._udp.familycooper.org,pbx.familycooper.org+srv-host=_sip._udp.domain.tld,hostname.domain.tld
  
 ## IP Lease Reservations ## IP Lease Reservations
 # #
-dhcp-host=08:00:27:fe:73:20,192.168.2.30,pbx +dhcp-host=08:00:27:fe:73:20,192.168.1.30,pbx 
-dhcp-host=00:0e:e9:02:cd:04,192.168.2.55,phone +dhcp-host=00:0e:e9:02:cd:04,192.168.1.55,phone 
-dhcp-host=00:13:20:74:9b:a8,192.168.2.50,mars +dhcp-host=00:13:20:74:9b:a8,192.168.1.50,mars 
-dhcp-host=00:0e:08:ef:3d:11,192.168.2.56,ata+dhcp-host=00:0e:08:ef:3d:11,192.168.1.56,ata 
 + 
 +# Specify boot file and optionally the TFTP server 
 +
 +#dhcp-boot=/tftpboot/pxelinux.0              # Specify boot file and optionally the TFTP server
  
 ## TFTP Server ## TFTP Server
 # #
-#enable-tftp # enable dnsmasq's built-in TFTP server +#enable-tftp                                 # enable dnsmasq's built-in TFTP server 
-#tftp-root=/var/lib/tftpboot # set the TFTP root directory+#tftp-root=/var/lib/tftpboot                 # set the TFTP root directory
 </file> </file>
  
networking/linux/dnsmasq.1329433616.txt.gz · Last modified: 2012/02/16 16:06 by gcooper