Skip to content

Instantly share code, notes, and snippets.

@themagic314
Last active February 19, 2021 17:10
Show Gist options
  • Save themagic314/af797685821f3eb941e7e2b5c6333d1a to your computer and use it in GitHub Desktop.
Save themagic314/af797685821f3eb941e7e2b5c6333d1a to your computer and use it in GitHub Desktop.
Unifi redirect all dns query to adguard/pihole. (config.gateway.json)
{
"service":{
"nat":{
"rule":{
"1":{
"description":"Redirect DNS queries to adguard/pihole",
"destination":{
"port":"53"
},
"source":{
"address":"!xx.xx.xx.xx"
},
"inside-address":{
"address":"xx.xx.xx.xx",
"port":"53"
},
"inbound-interface":"eth1",
"protocol":"tcp_udp",
"type":"destination"
},
"5002":{
"description":"Translate reply back",
"destination":{
"address":"xx.xx.xx.xx",
"port":"53"
},
"outbound-interface":"eth1",
"protocol":"tcp_udp",
"type":"masquerade"
}
}
}
}
}
@themagic314
Copy link
Author

themagic314 commented Feb 19, 2021

Replace xx.xx.xx.xx with your adguard/pihole IP.
Replace "eth1" in "outbound-interface" with your lan interface.

How-to edit config.gateway.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment