Dnsmasq Dhcp Hosts File

You may store your host configurations in multiple files with the --addn-hosts= option. Dnsmasq includes a syntax. These are answered only from /etc/hosts or DHCP. Dnsmasq supports static and dynamic DHCP leases and BOOTP/TFTP for network booting of diskless. Simply add them to your /etc/hosts file. HowTo/dnsmasq (last.

Dhcp Hosts

I am using dd-wrt (r23503, for the record) on my new Asus RT-AC56U router. Unfortunately, dnsmasq configuration is giving me nothing but headaches. Here's what I want: • DNS queries from the LAN/WLAN for hosts on the LAN/WLAN should be answered for both short names and FQDNs. • Since some of the devices are portable (like my phone), I need host.mydyndomain.net to resolve to a LAN IP when connected to the LAN and to the external IP when queried from outside the LAN.

But here is what I currently get: • Queries for DHCP leased hosts are being correctly returned (dd-wrt's 'Local DNS' option for dnsmasq). • Queries to any random non-existant host incorrectly return the external WAN IP address. So, 'nslookup foobarbaz' gives a result when it should return an error. As for my hosts with static IPs, I have not yet found an adequate solution.

I read through the dnsmasq manpage and from what I can tell, the correct choice is the 'host-record' option. The dnsmasq related configuration in dd-wrt (under the Services tab) is: 'DHCP Server' section: Used domain: WAN LAN domain: [blank] Additional DHCPd Options: [blank] One static lease defined. 'DNSMasq' section: DNSMasq: enabled Local DNS: enabled No DNS Rebind: enabled Additional DNSMasq Options: host-record=myhost,myhost.mydyndomain.net,192.168.1. 3d Ripper Dx Windows 8. 1 [several more host-record entries for the other hosts with static LAN IPs] Unfortunately, putting these host-record lines in the additional options box seems to completely break dnsmasq and then nothing can connect to the LAN/WLAN via DHCP. Once I empty the contents of the box then DHCP starts working again.

I have quite a bit of experience with dnsmasq on dd-wrt and especially close to the date of this comment. I can share with you my working solution to each of the answers to each requirement. I will resist adding more. Each option in your active /tmp/dnsmasq.conf comes directly from the config options you have selected as described Except for your hostname= entry which you should not use imo. You want Used Domain: [WAN/LAN] not Used Domain [WAN]. This will allow wired (LAN) and wireless (WAN) devices to work on your network. Also pick a short Lan Domain: [dom ] or any short word besides local.

Some use lan some use localdomain. This is required for your requirements and will provide an anchor faux internal only domain that only you and internal users will see/use. The value you choose will be put into each DHCP client's search dom resolver. I will use dom for the remainder but you can make it whatever you like. I will start with the first two requirements. • DNS queries from the LAN/WLAN for hosts on the LAN/WLAN should be answered for both short names and FQDNs. • Since some of the devices are portable (like my phone), I need host.mydyndomain.net to resolve to a LAN IP when connected to the LAN and to the external IP when queried from outside the LAN.

Comments are closed.