1
General Discussion / Re: DNS rewrite in one-to-one NAT
« on: January 17, 2024, 08:49:35 am »
Worked it out :-) What's happening on the Cisco box is DNS Doctoring, enabled by default on the router.
To get a similar functionality in OpnSense I enabled Dnsmasq with the following option in /usr/local/etc/dnsmasq.conf:
alias=x.x.x.0,y.y.y.0,255.255.255.0
where x.x.x.0 is internal subnet and y.y.y.0 is the NATed IPs.
I then placed a port forwarding rule for all DNS requests headed for the internal DNS servers to go to OpnSense instead, which in turn redirects requests to the internal servers and applies the alias to the responses.
To get a similar functionality in OpnSense I enabled Dnsmasq with the following option in /usr/local/etc/dnsmasq.conf:
alias=x.x.x.0,y.y.y.0,255.255.255.0
where x.x.x.0 is internal subnet and y.y.y.0 is the NATed IPs.
I then placed a port forwarding rule for all DNS requests headed for the internal DNS servers to go to OpnSense instead, which in turn redirects requests to the internal servers and applies the alias to the responses.