Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Don't let devices use their own DNS servers- redirect those queries to PiHole instead! Configuration snippet for EdgeOS/Vyatta
# Redirect outbound DNS requests to an internal DNS server (for EdgeOS/Vyatta)
# I adapted this configuration from https://old.reddit.com/r/pihole/comments/930g2z/psa_google_services_including_ads_and_others_try/e3t0rqu/?st=jkxfpzdv&sh=370942ba, but I had to make some tweaks,
# because the config in the comment will cause a massive flood of DNS requests that'll bring down your network if you don't filter destinations appropriately (as I've done below).
service {
nat {
rule 1 {
description "Redirect Outbound DNS Queries to PiHole Internally"
destination {
address !your.router's.ip.address
port 53
}
inbound-interface switch0
inside-address {
address your.pihole's.ip.address
}
log disable
protocol tcp_udp
source {
address !your.pihole's.ip.address
}
type destination
}
rule 6000 {
description "Translate Redirected Outbound DNS Requests"
destination {
address your.pihole's.ip.address
port 53
}
log disable
outbound-interface switch0
protocol tcp_udp
type masquerade
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.