diff --git a/src/dns/aardvark.rs b/src/dns/aardvark.rs index 20daa09de..1da03a3af 100644 --- a/src/dns/aardvark.rs +++ b/src/dns/aardvark.rs @@ -95,7 +95,7 @@ impl Aardvark { "--config", &self.config, "-p", - "53", + "1153", "run", ]); diff --git a/src/firewall/varktables/types.rs b/src/firewall/varktables/types.rs index 27f4f9132..c9a79940e 100644 --- a/src/firewall/varktables/types.rs +++ b/src/firewall/varktables/types.rs @@ -344,6 +344,18 @@ pub fn get_port_forwarding_chains<'a>( netavark_hashed_dn_chain.create = true; } + // Create redirection for aardvark-dns on non-standard port + if let Some(gateway) = network_address.gateway { + netavark_hostport_dn_chain.create = true; + netavark_hostport_dn_chain.build_rule(VarkRule::new( + format!( + "-j {} -d {} -p {} --dport {} --to-destination {}:{} {}", + DNAT, gateway, "udp", 53, gateway, 1153, comment_dn_network_cid + ), + None, + )); + } + for i in pfwd.port_mappings.clone() { if let Ok(ip) = i.host_ip.parse::() { match ip {