Solve Hostname without local domain
So my setup is pretty simple
- Pfsense old computer with two GbLan ports (wan and Lan)
- DHCP on Lan , with the subnet 192.168.30.0/24
- OpenVPN on subnet 192.168.5.0/24 working
- PfBlockerNG + DNSBL + GeoIP both working on lan and openvn
- Basic firewall rules to allow port 53,80,443 and email ports
Everything is working very well, and it's been a life saver , but i wanted to do two things a bit..."better"
Right now if im on lan (30.0/24) and i ping or smb into srv-example (\srv-example) is works, being a new or old pc, if the DHCP gave him a IP, it works.
But when i'm connected via openvpn, it doesnt work (yes i have on the unbound dns resolver the ticks to push dhcp static mappings and other mappings) unless i add the "domain" (aka \srv-example.domain)
Is there a way, either by dns resolver or forwarder that i can achieve on the Openvpn connection to say like a host file 192.168.30.10-> srv-example ? i've tried with the hosts overide but i just cant seem to get it working
other thing (less important one) : i have a couple of websites that i use h1,h2,h3,h4....h20.example.com and via hosts file on the machine i say they point to 127.0.0.1. is there a way to do this as well via pfsense?
see this, especially last post
you just solved me THE biggest problem i had. simply added the "Provide a default domain name to clients
" with the same domain as the pfsense and the host, reconnected and BAMM, it works, now i can smb into the machive or rdp, via its hostname !
now all i need is to figure those pesky 127.0.0.1 entries!
@helderingor There is, but its bad practice.
You could put host overides on unbound, but it will only work for the specific host that the sites are really on.
There is no point doing this at the network level.
Have you tried something like that?
@netblues i've since we started talking, managed to in DNS Resolver> Host Overides add , for example h1,h2 and h3.example.com and its now working, problem it that sometimes its like 20 websites, and its a bit of a eye sore to do that. i was looking into wildcards or something like that h**.example.com or even *.example.com. i know you can do that with dnsmasq but not working so far. i'll keep messing with this until i probably give up this perfect utopia of a dream
@netblues and it's solved, sometimes im just a bit too damn lazy. easy as in the advanced options, add
local-zone: "example.com" redirect
local-data: "example.com 86400 IN A 127.0.0.1"
server: local-zone: "example.com" redirect local-data: "example.com 86400 IN A 127.0.0.1"
Its in the docs too
yup, thats where i saw it.
guess next time ill dig a bit deeper before bothering you pros ahah