Skip to content

Instantly share code, notes, and snippets.

@wderuijter
Last active January 24, 2022 10:21
Show Gist options
  • Save wderuijter/08512f6551d2848e1fa437271608a4b8 to your computer and use it in GitHub Desktop.
Save wderuijter/08512f6551d2848e1fa437271608a4b8 to your computer and use it in GitHub Desktop.
Force internal DNS
{
"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"
}
}
}
}
}
@wderuijter
Copy link
Author

USG pro usually uses eth0. The regular USG uses eth1.

@wderuijter
Copy link
Author

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