Last active
January 24, 2022 10:21
-
-
Save wderuijter/08512f6551d2848e1fa437271608a4b8 to your computer and use it in GitHub Desktop.
Force internal DNS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"service": { | |
"nat": { | |
"rule": { | |
"1": { | |
"description": "Redirect DNS requests", | |
"destination": { | |
"port": "53" | |
}, | |
"inbound-interface": "eth1", | |
"inside-address": { | |
"address": "192.168.1.2-192.168.1.3", | |
"port": "53" | |
}, | |
"source": { | |
"address": "!192.168.1.2-192.168.1.3" | |
}, | |
"log": "disable", | |
"protocol": "tcp_udp", | |
"type": "destination" | |
}, | |
"6000": { | |
"description": "MASQ DNS requests to LAN", | |
"destination": { | |
"address": "192.168.1.2-192.168.1.3", | |
"port": "53" | |
}, | |
"log": "disable", | |
"outbound-interface": "eth1", | |
"protocol": "tcp_udp", | |
"type": "masquerade" | |
} | |
} | |
} | |
} | |
} |
Sources
https://www.reddit.com/r/pihole/comments/ahcb4n/i_made_a_usg_nat_rule_to_force_all_lan_dns/
https://github.com/stevejenkins/unifi-linux-utils/tree/master/config.gateway.json
https://github.com/stevejenkins/unifi-linux-utils/blob/master/config.gateway.json/force-dns-to-dual-piholes.json
Make sure the USG's WAN DNS server is set to an upstream DNS service like 1.1.1.1 and 1.0.0.1 for example. Otherwise a loop might occur.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
USG pro usually uses eth0. The regular USG uses eth1.