[SOLVED] Use dnsmasq to resolve hostnames on my lan
-
Hello everyone,
I am very much a beginner with pfSense so I apologize if this has been answered already as I tried looking for a solution but could not find exactly what I am looking for. If there is already a solution, please post a link to it and I will gladly look at it.
So A little bit about my setup:
I have a CentOS 7 box running the latest version with KVM and Open vSwitch. VMs are listed as
pfSense-vm (running as firewall/DHCP server, LAN=192.168.1.250 / WAN=public IP)
dns-vm (Debian 9 running dnsmasq, 192.168.1.60)
fileserver-vm (CentOS 7 running Samba/NFS, 192.168.1.30)
plexserver-vm (Debian 9 running Plex, 192.168.1.31)
windows10-vm (DHCP from pfSense-vm)
debian10-vm (DHCP from pfSense-vm)
I have other devices on my LAN that get their IP's via DHCP (Apple TV/printers/etc). I am trying to setup the dns-vm machine to handle all name resolutions for the devices on my LAN so I can ping/RDP to my machines via hostname instead of using their IP addresses (mainly for the DHCP'd clients), as well as send any non-local requests to the internet (hotmail.com / etc). I have turned off the DNS services on pfSense (DNS Forwarder/Resolver) and set the dns-vm as the primary DNS server (System > General Setup). In the dnsmasq.conf file of the VM, I configured it to forward external requests to 8.8.8.8 and can connect to the internet fine. The issue I am having is that I cannot resolve hostnames to IPs of my machines. I am pretty sure the issue is more with dnsmasq, however I wanted to see if anyone else might have an idea or suggestions I can try. If there is any info you may need me to post, please let me know and I will gladly provide it. Thanks in advance for any help offered.
-
@simon_lefisch said in Use dnsmasq to resolve hostnames on my lan:
DNS services on pfSense (DNS Forwarder/Resolver)
Which one - those are 2 different systems.. forwarder is dnsmasq, while resolver is unbound (which could also be set to forward vs resolve)
Out of the box is default resolver (unbound).
To resolve local names doesn't matter which one you use. You can either register dhcp clients, or you could setup host overrides for all you devices. Or you could setup dhcp reservations so clients always get the same IP and register reservations.
But you can do host overrides in either dnsmasq or unbound (you can only use 1 at a time).. So you could resolver host.domain.tld to their local IPs..
-
@johnpoz thanks for the reply. After poking around and reading up a bit more on the DNS services, I was able to get hostname resolution with the DNS Resolver service on pfSense. However at some point I think I would like to use my DNS VM as the main DNS server for my LAN. Do you have any suggestions about that?
-
Sure you can do that - if the that dns will have your local records, and you want pfsense to be able to resolve them for say the firewall logs.. Just setup a domain override pointing to your NS for whatever domain your hosts are in.
-
Thanks for your input @johnpoz. I will look into that later.