Solvedoutline client Using custom DNS server instead of OpenDNS

Anyone knows how can I change the DNS for the clients? Currently they are using OpenDNS by default. I need to use my internal DNS server.

18 Answers

✔️Accepted Answer

Solve it by

iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to $custom_dns_ip:53;
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to $custom_dns_ip:53;
iptables -t nat -A POSTROUTING -j MASQUERADE

It means:

  1. Any local user contacting out world to port tcp 53 send to $custom_dns_ip at port 53.
  2. Same as 1 but for udp
  3. Set the source information on the outgoing packet as coming from us.

Other Answers:

Maybe 1.1.1.1 would be an option too?

@hd-deman I see what you did there, glad it works for you but we'd rather make this setting explicit in the client vs. having the server silently rewrite queries.

@pascalandy iptables is one of the hardest problems in computer science :-)

Then you should've let user decide what DNS server they want to use, DNS clearly plays a big part in privacy.

More Issues: