I Have an Ubuntu 16.04 host ( with DNSMasq installed which is only serving up DNS, and a couple Windows hosts on the same subnet, as well as a couple other Linux hosts on the same subnet. My default gateway is handing out DHCP as well as handing out for a DNS server.

The Windows boxes do not have a DNS search suffix or domain defined, but I want to be able to have them resolve hosts that I've defined in my /etc/hosts on the DNSMasq server WITHOUT having to specify domains or search suffixes, but this is proving to be difficult. According to Wireshark, the Windows hosts always want to append .local when performing a ping or trying to navigate to a web service on the Linux hosts.

My /etc/hosts file is as follows: localhost box-linux-0 box-linux-0.local box-linux-1 box-linux-1.local box-linux-2 box-linux-2.local box-windows-0 box-windows-0.local box-windows-1 box-windows-1.local

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

My DNSMasq config is:


And my resolv.conf is:


Is there something I'm missing to allow the Windows hosts to just be able to resolve box-linux-0, box-linux-1, box-linux-2?

1 Answer 1


Your resolv.conf should not have external DNS servers to ensure that dnsmasq is resolving all DNS requests. Change to:


To allow the resolution of external DNS names, use dnsmasq as the global DNS server by telling it to use some external DNS server. Add to DNSmasq config file:

--server Specify IP address of upstream servers directly.


To make dnsmasq to only resolve names that could actually be global dns names add to DNSmasq config file:

# Never forward plain names (without a dot or domain part)
# Never forward addresses in the non-routed address spaces.

To ensure that local names are resolved by /etc/hosts add to DNSmasq file:

# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.

You could try this option (may be useful or not):

# Set this (and domain: see below) if you want to have a domain
# automatically added to simple names in a hosts-file.

# Set the domain for dnsmasq. this is optional, but if it is set, it
# does the following things.
# 1) Allows DHCP hosts to have fully qualified domain names, as long
#     as the domain part matches this setting.
# 2) Sets the "domain" DHCP option thereby potentially setting the
#    domain of all systems configured by DHCP
# 3) Provides the domain part for "expand-hosts"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .