OPNsense Forum

English Forums => General Discussion => Topic started by: schtebo on November 27, 2019, 08:31:35 AM

Title: translate the ip address 8.8.8.8 to 192.168.1.53
Post by: schtebo on November 27, 2019, 08:31:35 AM
Hi,
is it possible to translate the ip address 8.8.8.8 to 192.168.1.53? and how can i do that?
192.168.1.53 is my internal dns-server.
my goal is, that all queries send to 8.8.8.8 will be answered by my own dns-server. :)
thank you + br
schtebo
Title: Re: translate the ip address 8.8.8.8 to 192.168.1.53
Post by: muchacha_grande on November 27, 2019, 11:49:28 AM
Hi,
in System > Settings > General yo can enter 192.168.1.53 as your DNS server and uncheck "Allow DNS server list to be overridden by DHCP/PPP on WAN"

After that, you can allow OPNSense be your DNS server so every query will be forwarded to your chosen IP.
Title: Re: translate the ip address 8.8.8.8 to 192.168.1.53
Post by: hbc on November 27, 2019, 11:54:51 AM
Sure, it is a pretty simple redirect.

Just set up a forward rule 'Firewall: NAT: Port Forward' and forward src any, dst host 8.8.8.8 port 53 to 192.168.1.53 port 53.

Since there exist more public dns servers (8.8.4.4, 1.1.1.1, 9.9.9.9 and many more), I would modify your redirect like this:


With this rules, clients already using your dns are not redirected. Every client using any other dns server than defined in My_DNS, gets redirected to yours.
Title: Re: translate the ip address 8.8.8.8 to 192.168.1.53
Post by: hbc on November 27, 2019, 12:52:02 PM
Quote from: muchacha_grande on November 27, 2019, 11:49:28 AM
Hi,
in System > Settings > General yo can enter 192.168.1.53 as your DNS server and uncheck "Allow DNS server list to be overridden by DHCP/PPP on WAN"

After that, you can allow OPNSense be your DNS server so every query will be forwarded to your chosen IP.

This just affects the DNS server, OPNsense uses itself. He wants to redirect his clients to his DNS server. And I don't think his provider assigns Google DNS 8.8.8.8 as dns  ;)