#http://thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example #------------------------------------------------------------------------------- # /etc/dnsmasq.conf # openwrt.: /etc/init.d/S50dnsmasq | dnsmasq --conf-file /etc/dnsmasq.conf # sveasoft: nvram set dnsmasq_options=conf-file=/usr/local/etc/dnsmasq.conf #bind/non-bind interfaces #except-interface=vlan1 #configuration files #addn-hosts=/base/etc/hosts resolv-file=/etc/resolv.conf read-ethers #general options dhcp-authoritative expand-hosts domain-needed filterwin2k bogus-priv no-poll no-negcache #only /etc/hosts and dhcp-cache lookups (no forwarding) local=/lan/ local=/local.lan/ domain=local.lan address=/aph.local.lan/192.168.4.10 # dhcp addresses, lease time (Nm,Nh), range, and lease file dhcp-range=192.168.4.100,192.168.4.149,255.255.255.0,1440m dhcp-lease-max=50 dhcp-leasefile=/tmp/dhcp.leases # custom: default route(s): ip,ip dhcp-option=3,192.168.4.1 #custom: dns server(s): ip,ip dhcp-option=6,0.0.0.0,192.168.6.10,4.2.2.1,4.2.2.2 # custom: pxe/tftp/bootp configuration #dhcp-boot=/pxelinux.0,192.168.4.6,192.168.4.6 dhcp-boot=/pxelinux.0,192.168.4.6,192.168.4.99 dhcp-option=17,/nfsroot-x86 # velociraptor 700 bootp BFN (BOOTP assignments) dhcp-host=00:10:E0:05:3C:33,192.168.4.21,v700x1e0,1440m dhcp-host=00:10:E0:05:3C:34,192.168.4.22,v700x1e1,1440m dhcp-host=00:03:47:97:C6:B3,192.168.4.23,v700x1e2,1440m dhcp-host=00:03:47:97:C6:B4,192.168.4.24,v700x1e3,1440m dhcp-host=00:10:E0:05:3C:7F,192.168.4.26,v700x2e0,1440m # custom PXE/NFS (ip from pool) dhcp-host=00:10:E0:03:*:*,net:cob dhcp-boot=net:cob,/pxelinux.0,debian,192.168.4.99 dhcp-option=net:cob,17,/nfsroot-x86 # custom PXE/NFS (ip from pool) dhcp-host=00:0C:29:D4:4D:*,net:bsd dhcp-boot=net:bsd,/pxeboot.0,x,192.168.4.6 dhcp-option=net:bsd,17,/nfsbsd # custom PXE/NFS (ip reservation) #dhcp-host=00:10:E0:03:*:*,192.168.4.200,dbug1,12h,net:x #dhcp-boot=net:x,/pxelinux.0,x,192.168.4.99 #dhcp-option=net:x,17,/nfsroot-x86 # custom ip via mac #dhcp-host=01:23:45:67:89:1A,192.168.4.20,dbug1,12h,id:* #dhcp-host=AA:BB:CC:DD:EE:FF,192.168.4.21,dbug2,12h,id:* #dhcp-host=00:07:50:CA:B8:EE,192.168.4.109,ciscopcx,24h,id:* #------------------------------------------------------------------------------- cobalt2 eth0: Intel PCI EtherExpress Pro100 82559ER, 00:10:E0:03:50:C3, I/O at 0x6200, IRQ 11. eth1: Intel PCI EtherExpress Pro100 82559ER, 00:10:E0:03:51:8A, I/O at 0x6240, IRQ 10. dhcp-option=net:red,option:ntp-server,192.168.1.1 #example dhcp-host=00:10:E0:03:*:*,net:cob #no dhcp-host=00:10:E0:03:*:*,192.168.4.61,cobx2,12h,net:cob #yes dhcp-host=00:10:E0:03:50:C3,192.168.4.61,cobx2,12h,net:cob #yes dhcp-mac=cob,00:10:E0:03:*:* #no dhcp-boot=net:cob,/pxelinux.0,debian,192.168.4.99 #? dhcp-option=net:cob,17,/nfsroot-x86 $? #------------------------------------------------------------------------------- dhcp-host=11:22:33:*:*:*,net:red dhcp-mac=cob,00:60:8C:*:*:* dhcp-vendorclass=cob,Linux dhcp-userclass=cob,xuserclassx dhcp-option=net:cob,3,1.2.3.4 dhcp-option=net:red,option:ntp-server,192.168.1.1 # Set the boot file name only when the "red" tag is set. #dhcp-boot=net:red,pxelinux.red-net # Send extra options which are tagged as "red" to # the machine with ethernet address 11:22:33:44:55:66 #dhcp-host=11:22:33:44:55:66,net:red # Send extra options which are tagged as "red" to # any machine with ethernet address starting 11:22:33: #dhcp-host=11:22:33:*:*:*,net:red # Send extra options which are tagged as "red" to any machine whose # DHCP vendorclass string includes the substring "Linux" #dhcp-vendorclass=red,Linux # Send extra options which are tagged as "red" to any machine one # of whose DHCP userclass strings includes the substring "accounts" #dhcp-userclass=red,accounts # Send extra options which are tagged as "red" to any machine whose # MAC address matches the pattern. #dhcp-mac=red,00:60:8C:*:*:* # Note: # The following example may not work for PXE where dhcp-host method # does as PXE is BOOTP and dhcp-host activates a BOOTP query. This # method is most likely more effective for DHCP requests! #dhcp-mac=red,00:60:8C:*:*:* #------------------------------------------------------------------------------- # redirect advertisements address=/doubleclick.net/127.0.0.1 # Set the limit on DHCP leases, the default is 150 dhcp-lease-max=150 #dhcp range with network-id dhcp-range=red,192.168.0.50,192.168.0.150 #dhcp host reservation: ip address dhcp-host=11:22:33:44:55:66,192.168.0.60 #dchp host reservation: hostname dhcp-host=11:22:33:44:55:66,xhostx #dchp host reservation: hostname, ip, lease time dhcp-host=11:22:33:44:55:66,xhostx,192.168.0.60,45m #dhcp host reservation: give host bert ip and lease time infinite dhcp-host=bert,192.168.0.70,infinite #dhcp host ip assignment for client identifier: 01:02:02:04 dhcp-host=id:01:02:02:04,192.168.0.60 #dhcp host ip assignment for client identifier: marjorie dhcp-host=id:marjorie,192.168.0.60 #assign ip address listed in /etc/hosts for client judge dhcp-host=judge #ignore client with MAC dhcp-host=11:22:33:44:55:66,ignore # Ignore any client-id presented by the machine with ethernet # address 11:22:33:44:55:66. This is useful to prevent a machine # being treated differently when running under different OS's or # between PXE boot and OS boot. dhcp-host=11:22:33:44:55:66,id:* # Send extra options which are tagged as "red" to # the machine with ethernet address 11:22:33:44:55:66 dhcp-host=11:22:33:44:55:66,net:red # Send extra options which are tagged as "red" to # any machine with ethernet address starting 11:22:33: dhcp-host=11:22:33:*:*:*,net:red # Send extra options which are tagged as "red" to any machine whose # DHCP vendorclass string includes the substring "Linux" dhcp-vendorclass=red,Linux # Send extra options which are tagged as "red" to any machine one # of whose DHCP userclass strings includes the substring "accounts" dhcp-userclass=red,accounts # Send extra options which are tagged as "red" to any machine whose # MAC address matches the pattern. dhcp-mac=red,00:60:8C:*:*:* # Override the default route supplied by dnsmasq, which assumes the # router is the same machine as the one running dnsmasq. This can be # done using option number or option name. dhcp-option=3,1.2.3.4 dhcp-option=option:router,1.2.3.4 # Send the etherboot magic flag and then etherboot options (a string). dhcp-option=128,e4:45:74:68:00:00 dhcp-option=129,NIC=eepro100 # Specify an option which will only be sent to the "red" network # (see dhcp-range for the declaration of the "red" network) # Note that the net: part must precede the option: part. dhcp-option = net:red, option:ntp-server, 192.168.1.1 # Send RFC-3442 classless static routes (note the netmask encoding) dhcp-option=121,192.168.1.0/24,1.2.3.4,10.0.0.0/8,5.6.7.8 # Send vendor-class specific options encapsulated in DHCP option 43. # The meaning of the options is defined by the vendor-class so # options are sent only when the client supplied vendor class # matches the class given here. (A substring match is OK, so "MSFT" # matches "MSFT" and "MSFT 5.0"). This example sets the # mtftp address to 0.0.0.0 for PXEClients. dhcp-option=vendor:PXEClient,1,0.0.0.0 # Send microsoft-specific option to tell windows to release the DHCP lease # when it shuts down. Note the "i" flag, to tell dnsmasq to send the # value as a four-byte integer - that's what microsoft wants. See # http://technet2.microsoft.com/WindowsServer/en/library/a70f1bb7-d2d4-49f0-96d6-4b7414ecfaae1033.mspx?mfr=true dhcp-option=vendor:MSFT,2,1i # Send the Encapsulated-vendor-class ID needed by some configurations of # Etherboot to allow is to recognise the DHCP server. dhcp-option=vendor:Etherboot,60,"Etherboot" # Send options to PXELinux. Note that we need to send the options even # though they don't appear in the parameter request list, so we need # to use dhcp-option-force here. # See http://syslinux.zytor.com/pxe.php#special for details. # Magic number - needed before anything else is recognised dhcp-option-force=208,f1:00:74:7e # Configuration file name dhcp-option-force=209,configs/common # Path prefix dhcp-option-force=210,/tftpboot/pxelinux/files/ # Reboot time. (Note 'i' to send 32-bit value) dhcp-option-force=211,30i # Set the boot filename for BOOTP. You will only need # this is you want to boot machines over the network and you will need # a TFTP server; either dnsmasq's built in TFTP server or an # external one. (See below for how to enable the TFTP server.) dhcp-boot=pxelinux.0 # Boot for Etherboot gPXE. The idea is to send two different # filenames, the first loads gPXE, and the second tells gPXE what to # load. The dhcp-match sets the gpxe tag for requests from gPXE. dhcp-match=gpxe,175 # gPXE sends a 175 option. dhcp-boot=net:#gpxe,undionly.kpxe dhcp-boot=mybootimage # Set the boot file name only when the "red" tag is set. dhcp-boot=net:red,pxelinux.red-net # An example of dhcp-boot with an external server: the name and IP # address of the server are given after the filename. dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3 # Set the DHCP server to authoritative mode. In this mode it will barge in # and take over the lease for any client which broadcasts on the network, # whether it has a record of the lease or not. This avoids long timeouts # when a machine wakes up on a new network. DO NOT enable this if there's # the slighest chance that you might end up accidentally configuring a DHCP # server for your campus/company accidentally. The ISC server uses # the same option, and this URL provides more information: # http://www.isc.org/index.pl?/sw/dhcp/authoritative.php dhcp-authoritative # Run an executable when a DHCP lease is created or destroyed. # The arguments sent to the script are "add" or "del", # then the MAC address, the IP address and finally the hostname # if there is one. dhcp-script=/bin/echo # Normally responses which come form /etc/hosts and the DHCP lease # file have Time-To-Live set as zero, which conventionally means # do not cache further. If you are happy to trade lower load on the # server for potentially stale date, you can set a time-to-live (in # seconds) here. local-ttl= # Change the following lines to enable dnsmasq to serve TXT records. # These are used for things like SPF and zeroconf. (Note that the # domain-name expansion done for SRV records _does_not # occur for TXT records.) # Example SPF. txt-record=example.com,"v=spf1 a -all" # Example zeroconf txt-record=_http._tcp.example.com,name=value,paper=A4 # For debugging purposes, log each DNS query as it passes through # dnsmasq. log-queries # Log lots of extra information about DHCP transactions. log-dhcp # Include a another lot of configuration options. conf-file=/etc/dnsmasq.more.conf conf-dir=/etc/dnsmasq.d #-------------------------------------------------------------------------------