2

Setup

There are at minimum 3 devices involved in my setup:

  • raspberry pi: This has dnsmasq configured and is intended solely to function as a DNS server for my LAN, should I choose to use it instead of the router's upstream server.
  • personal laptop: I run a web server from a flash drive here and need it to be reachable by the rest of the LAN, hence the RPI.
  • variable number of Windows laptops: These are being provisioned, and the web page is used to guide me through the process and supply resources for installation.

Problem

The Windows laptops I'm provisioning can't find my personal laptop by its FQDN, requiring me to use the IP address. This is also true of trying to use my android phone for testing after setting the RPI as my DNS server. This is my first time configuring dnsmasq, but I'm not particularly new to DNS or networking in general.

What am I missing here that's not letting my Windows/Android clients connect to my RPI host by setting it as their DNS server?

Testing

From the RPI host running dnsmasq, I can use nslookup to find my laptop.

# by its host name
pi@pi:~ $ nslookup nwirp
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   nwirp
Address: 10.0.0.210

# by its FQDN
pi@pi:~ $ nslookup nwirp.tools.localhost
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   nwirp.tools.localhost
Address: 10.0.0.210

From my VM running linux on my personal laptop, I'm able to find my laptop after setting the RPI as its DNS server:

owner@owo:~$ nslookup nwirp
Server:         10.0.0.100
Address:        10.0.0.100#53

Name:   nwirp
Address: 10.0.0.210

owner@owo:~$ nslookup nwirp.tools.localhost
Server:         10.0.0.100
Address:        10.0.0.100#53

Name:   nwirp.tools.localhost
Address: 10.0.0.210

Yet when I go into Windows and try doing this despite having the DNS server set it never seems to default or defer to it and chooses the comcast one.

> nslookup nwirp
Server:  cdns01.comcast.net
Address:  2001:558:feed::1

*** cdns01.comcast.net can't find nwirp: Non-existent domain

> nslookup nwirp.tools.localhost
Server:  cdns01.comcast.net
Address:  2001:558:feed::1

*** cdns01.comcast.net can't find nwirp.tools.localhost: Non-existent domain

I know I can force nslookup to use my server by adding the IP address at the end of the command like so

> nslookup nwirp.tools.localhost 10.0.0.100
Server:  tools.localhost
Address:  10.0.0.100

Name:    nwirp.tools.localhost
Address:  10.0.0.210

but the problem is that's just within the scope of nslookup, it's the browsers that I need to use the DNS server.

Attempts at making Windows Utilize Dnsmasq

I've tried:

  • setting the DNS server through the static IP setup through my wifi connection's settings
  • setting it at the IPv4 configuration through Control Panel > Network and Sharing Center > Connection > Wi-Fi Properties
  • (edit) disabling IPv6 configuration to force my IPv4 DNS server to be used from the previous point. This makes nslookup work on Windows as intended without having to specify my IP, but does not carry over to the browser which will tell me the connection was Refused regardless of which browser I am using (FF, Chrome/Chromium based browsers). Interestingly, I can use curl/Invoke-WebRequest to successfully send a GET request after disabling IPv6.
  • setting it through PowerShell via set-dnsclientserveraddress -interfacealias "wi-fi" -serveraddress ("10.0.0.100")
  • (edit) specifying my RPI as the DNS over HTTPS provider in the browser.
  • (edit) disabling DNS over HTTPS in the browser.

Part of me believes this is Windows requiring more work to configure than linux that seemed to work straightaway after updating /etc/resolv.conf - but there's also that note about my phone not finding it either after specifying the DNS server so I can't rule out that dnsmasq is not configured correctly.

Dnsmasq Configurations

/etc/hosts

pi@pi:~ $ cat /etc/hosts
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
127.0.1.1       raspberrypi

10.0.0.210      nwirp
10.0.0.100      tools.localhost

/etc/resolv.conf

# This file is immutable

pi@pi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
nameserver 127.0.0.1

/etc/dnsmasq.conf

pi@pi:~ $ cat /etc/dnsmasq.conf
expand-hosts
server=1.1.1.1
resolv-file=/etc/resolv.conf
log-queries
log-facility=/var/log/dnsmasq.log
domain=tools.localhost
local=/local./

Dnsmasq Logs

Relevant log file lines

# RPI nslookup
pi@pi:~ $ sudo egrep "(nwirp|tools)" /var/log/dnsmasq.log
Jul 14 18:15:11 dnsmasq[7007]: query[A] nwirp from 127.0.0.1
Jul 14 18:15:11 dnsmasq[7007]: /etc/hosts nwirp is 10.0.0.210
Jul 14 18:15:11 dnsmasq[7007]: query[AAAA] nwirp from 127.0.0.1
Jul 14 18:15:11 dnsmasq[7007]: forwarded nwirp to 1.1.1.1
Jul 14 18:15:11 dnsmasq[7007]: reply nwirp is NODATA-IPv6

# RPI nslookup
Jul 14 18:16:57 dnsmasq[7007]: query[A] nwirp.tools.localhost from 127.0.0.1
Jul 14 18:16:57 dnsmasq[7007]: /etc/hosts nwirp.tools.localhost is 10.0.0.210
Jul 14 18:16:57 dnsmasq[7007]: query[AAAA] nwirp.tools.localhost from 127.0.0.1
Jul 14 18:16:57 dnsmasq[7007]: forwarded nwirp.tools.localhost to 1.1.1.1
Jul 14 18:16:57 dnsmasq[7007]: reply nwirp.tools.localhost is NODATA-IPv6

# Windows nslookup
Jul 14 18:17:57 dnsmasq[7007]: query[A] nwirp.hsd1.wa.comcast.net from 10.0.0.210
Jul 14 18:17:57 dnsmasq[7007]: forwarded nwirp.hsd1.wa.comcast.net to 1.1.1.1
Jul 14 18:17:57 dnsmasq[7007]: reply nwirp.hsd1.wa.comcast.net is NXDOMAIN

# Windows nslookup
Jul 14 18:17:57 dnsmasq[7007]: query[A] nwirp.hsd1.wa.comcast.net from 10.0.0.210
Jul 14 18:17:57 dnsmasq[7007]: cached nwirp.hsd1.wa.comcast.net is NXDOMAIN
Jul 14 18:19:48 dnsmasq[7007]: query[A] nwirp.hsd1.wa.comcast.net from 10.0.0.210
Jul 14 18:19:48 dnsmasq[7007]: cached nwirp.hsd1.wa.comcast.net is NXDOMAIN

# VM nslookup
Jul 14 18:19:48 dnsmasq[7007]: query[A] nwirp from 10.0.0.210
Jul 14 18:19:48 dnsmasq[7007]: /etc/hosts nwirp is 10.0.0.210
Jul 14 18:19:48 dnsmasq[7007]: query[AAAA] nwirp from 10.0.0.210
Jul 14 18:19:48 dnsmasq[7007]: cached nwirp is NODATA-IPv6

# VM nslookup
Jul 14 18:19:54 dnsmasq[7007]: query[A] nwirp.tools.localhost from 10.0.0.210
Jul 14 18:19:54 dnsmasq[7007]: /etc/hosts nwirp.tools.localhost is 10.0.0.210
Jul 14 18:19:54 dnsmasq[7007]: query[AAAA] nwirp.tools.localhost from 10.0.0.210
Jul 14 18:19:54 dnsmasq[7007]: cached nwirp.tools.localhost is NODATA-IPv6

Update: Testing similar browsers but on Linux

I just installed a GUI on my linux VM + Firefox and have confirmed that a browser on linux has no problem using dnsmasq but a browser on Windows is proving to be difficult. At least with this, I'm pretty sure(?) dnsmasq is setup properly but then I don't know what to do with Windows.

1 Answer 1

0

Your missing a . after the domain=tools.localhost

domain=tools.localhost.
1
  • Making this change to the config didn't let the windows clients resolve the name -- but just adding a dot after the host in the windows browser's url did bring it up! Thank you for a point in the right direction. In my case I did nwirp.:8000 , which isn't the FQDN but works enough for what I need!
    – Sani Evans
    Commented Jul 15, 2022 at 18:05

You must log in to answer this question.

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