User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Getting DNS on a Pi 3 Webserver in a Walled Garden

Tue Mar 21, 2017 11:50 am

Hi,

I am trying to set up a Webserver at our local Model Town, so that visitors can listen to Audio Guides and fill in an online Quiz using their phones or tablets. However, I'm having problems with DNS setup.

The hardware is:
1. Pi 3 with UPSPico for power cuts.
2. TP-Link TL-WA7210N Outdoor Wireless Access Point. This is connected to the Pi via an Ethernet cable.

The software (so far) is:
1. nginx.
2. dnsmasq.

The webserver works fine if I enter the IP address of the Pi into the browser on the phone, but not if I enter the domain name that I want to use for the Pi ('WMT'). The phone is trying to get to Google's DNS server to resolve the address.

Here is what I've done in the AP's config page:
1. Set up the built-in DHCP server to dish out IP addresses to visitors devices and made the Pi's Mac address have a fixed IP.
2. Set the DNS server and Gateway addresses to the Pi's IP.

Here is what I've done on the Pi:
1. Provided the hostname 'WMT' in /etc/hosts.
2. Told dnsmasq to listen on eth0 in dnsmasq.conf.
3. Entered the domain 'WMT' and the address of the Pi as the nameserver in resolve.conf.

What I have I missed? As the title of this post says, this will be a walled garden because the Town, which is a charity, cannot afford to provide free internet access to the visitors. Otherwise, we'd put the whole thing on the Internet and point them at it.

User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Getting DNS on a Pi 3 Webserver in a Walled Garden

Tue Mar 21, 2017 12:29 pm

Replying to myself, because I seem to have fixed it. It suddenly occurred to me that the phone was trying to get to Google because it sees 'WMT' as a search term rather than a URL when it is typed into the address bar. I changed the name of the domain to 'WMT.com' and it now works.

One final question. The file resolve.conf is clearly being updated automatically and my change got overwritten by the old name 'WMT'. Where does that come from?

Return to “Beginners”