Skip to content

Instantly share code, notes, and snippets.

@alfredodeza
Created December 12, 2023 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfredodeza/280f222f6cb02e19bdb049f784eb2245 to your computer and use it in GitHub Desktop.
Save alfredodeza/280f222f6cb02e19bdb049f784eb2245 to your computer and use it in GitHub Desktop.
Force Forward DNS in Edge Router

Force DNS to any client on your network

Enforce any client that uses port 53 for a DNS lookup to get redirected to the DNS server of your choice. This effectively forces any client with custom or self-configured DNS to still go through your DNS server of choice.

UI Settings

Navigate to the UI and then to: Firewall/NAT -> NAT. Click on "Add a Destination NAT Rule". In my case eth1 is the port all clients go and eth0 is where the WAN goes in, and 192.168.0.1 is the router itself where the DNS server is

  • Inbound interface: eth1
  • Translations Address: 192.168.0.1
  • Translations Port: 53
  • Protocol: Both TCP and UDP
  • Src Address: 192.168.0.2-192.168.0.254
  • Dest Address: !192.168.0.1
  • Dest Port: 53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment