Hello,
I also could not access my NCP websites from within my local network because my router does not do NAT loopback.
Here is some feedback from my own experience with setting up dnsmasq on NextcloudPi… it took me HOURS.
I followed the guide here: dnsmasq as DNS cache server for NextCloudPi and Raspbian to help set up dnsmasq and I also googled loads.
If you start to configure dnsmasq in the Terminal User Interface in NextCloudPi image then you will notice that the form entry is different from shown on that webpage.
If you are able to adjust the Primary DNS of your router to the local IP address of your Pi then the value to enter in the DNSSERVER field in the TUI should be the local IP address of your router. I really think the webpage is confusing on this part and that cost me hours.
I have NextCloudPi running on my Pi attached to my local network. I only need dnsmasq to work as a local dns server so I can access the NextCloudPi websites from within my local network… no caching or dhcp or anything else.
In the end I was able to modify /etc/dnsmasq.conf to just this:
interface=eth0
domain-needed # Never forward plain names (without a dot or domain part)
bogus-priv # Never forward addresses in the non-routed address spaces.
no-poll # Don't poll for changes in /etc/resolv.conf
no-resolv # Don't use /etc/resolv.conf or any other file
cache-size=150
server=192.168.1.254 # Local ip address of my router
address=/my.domain.com/192.168.1.124 # Local ip of my Pi. This is optional if we add it to /etc/hosts
The domain name I use to open the NCP website is not listed in my /etc/hosts file at all, it only needs to be in /etc/dnsmasq.conf
After making changes to dnsmasq.conf… reload: >> /etc/init.d/dnsmasq restart
Status and error info about dnsmasq are reported to /var/log/daemon.log
You can also make a custom log file simply by adding the following line: log-facility=/path/to/logfile
to your /etc/dnsmasq.conf so you can monitor if things are going well
I got a line in /var/log/daemon.log that said: “using nameserver 192.168.1.254#53” which means that dnsmasq is running and listening on port 53 to local ip of my router on which I had set the primary dns as the local ip of my Pi.
I also had HSTS errors in Chrome when trying to access me NCP websites from within my own local network. This link: Re-Hashed: How to clear HSTS settings in Chrome and Firefox showed me how to clear the HSTS error. Basically if you are using Chrome go to chrome://net-internals/#hsts and type the domain name you use into the Delete domain section and click delete.
Of course after this you will still get Invalid certificate errors if like me you were trying to access the NCP websites from within your local network, that’s where dnsmasq comes in…
Let me know if you need any more help with dnsmasq… I might be able to sort you out.
Flex