I have an web server running apache web server in my home network. My router unfortunately does not allow NAT loopback, so testing my own projects, or accessing other self-hosted services (owncloud, seafile,etc) can only by done using my internal server IP while I am connected to my LAN, and using my DNS domain outside my LAN. Obviously this back and forth is not ideal.
After considering the possible solutions, I came to the conclusion that least painful way to resolve DNS domains that point to my internal IP is to host my own DNS server and configuring my router to use my local DNS server. dnsmasq seems like a good choice for this.
However, as I was about to install dnsmasq in the same server that is running apache, docker, among other services, I was wondering what would be the least intrusive way to configure dnsmasq so it doesn't accidentally break other services already running in my local server. In addition, I was wondering if dnsmasq will allow the server (localhost) to access a DNS domain that redirects backs to itself, given that I will likely have to map a public address to its internal IP so it can be properly accessed by any device connected to my lan (example.com --> [IP of local server in LAN] and not example.com --> 127.0.0.1). Is there a way to resolve this issue in dnsmasq, so that all the LAN devices, including the local server, can access the same site using a public address?
UPDATE #1
Before installation, running: sudo nmap -sn 192.168.10.0/24
to see the IPs of my LAN devices will return a line containing the nickname of my server (I am not sure who assigns the nickname, maybe the router?) and its IP as follows:
Nmap scan report for myserver.lan (192.168.10.130)
However, after installing dnsmasq and using it as my default DNS server in my router config, the nickname for my server is gone. If I do sudo nmap -sn 192.168.10.0/24
it will return a line containing Nmap scan report for 192.168.10.130
. If I try to access my server from a different computer in my LAN as I used to do before dnsmasq, by typing myserver.lan, is not longer redirecting to my local server.