Skip to main content Why is it hard to set custom DNS on OpenWRT, and how do I set it properly? : r/openwrt
Go to openwrt
•

Why is it hard to set custom DNS on OpenWRT, and how do I set it properly?

I have set custom DNS for IPv4 and IPv6 in both WAN and WAN6. But they never work. I still cannot bypass ISP-blocked websites on all devices I own.

r/openwrt - WAN
WAN

r/openwrt - WAN6
WAN6

Every single search suggesting different ways to set up the DNS. So, what is the correct way to do this? Why is it so complicated, unlike regular router firmware where we could fill in a box and it will work right away?

I did this successfully a few years ago, but I cannot recall how I did it.

Thank you.

The numbers don't lie - there's a reason why 10,000+ customers rate monday.com 5 stars and use it as their work management platform. It’s the #1 platform to efficiently manage your team, work, and processes. Try it now!
Thumbnail image: The numbers don't lie - there's a reason why 10,000+ customers rate monday.com 5 stars and use it as their work management platform. It’s the #1 platform to efficiently manage your team, work, and processes. Try it now!
Sort by:
Best
Open comment sort options

You probably just need to set the dhcp option (6) to tell your clients what DNS server to use.

• • Edited

This. It's in advanced DHCP settings in Luci. I had the same issue when I set up my pihole. Put in the number 6, followed by a comma, then your preferred dns server IP (s).

Here's a blog post by someone who did something similar: https://www.ismoothblog.com/2021/06/configure-pi-hole-on-openwrt-router.html?m=1

More replies

Your ISP could be hijacking your DNS requests, even if you are using Google's DNS. Go to the "Network" > "Diagnostics" page, and try the "Nslookup" utility with the blocked sites.

More replies

Check using dnsleak.com if dns isp provider visible your configuration wrong somewhere.

If none dns isp provider but you can't still access block website your provider using DPI

Im literally losing my mind over this right now. Ive tried every goddamn way of setting the DNS and none of them works. This is a 2 second job on every router in existence and for some reason on OpenWRT this is more complicated than splitting atoms. I cant for the life of me understand whats going on in Linux ppls heads at times.
Rant over.

in case anyone is here in the future and are on the same excruciating journey of setting a simple string value such as the DNS, which OpenWRT considers *HIGH TECH SHIT*, then the solution is apparently the following:

First try absolutelly everything. Add your DNS server to absolutelly every input field you can find throughout the entire modem. Reboot your router aproximatelly 1 million times in the process (it should be glowing red from overheating by the end of this, because remember, we are updating A SINGLE FUCKING STRING, this needs all the computing power it has.

Now, after entering the DNS server of choice in all input fields of both related and unrelated fields, embrace yourself for.... nothing. Not a single goddamn thing.
oh and remember to flush your dns through every iteration just to make sure that indeed nothing did work.
Then, when you eventually give up, find a hammer and smash your entire modem to bits while shouting all the curse words in all of the official languages of the world. No you know what, include the unofficial languages aswell, because, you know, we are updating the DNS in openWRT here.
Then, after waiting aproximatelly 1 week for another router to arrive by mail and after finishing flashing openWRT to the router, manually configure your nameserver in the following file:
/etc/resolv.conf
It should say: nameserver <YOUR DNS IP>
And, atleast for me, problem solved.

It should come as no surprise that I am both a Linux and OpenWRT moron, but holy hell this wasnt particularly good UX to say the least. And Im fully aware that A skilled Linux developer reading this, most likely has already concluded that Im indeed a dumbass, of which I will agree.
I am severely grateful to the community for developing OpenWRT, which ofc is an open-source platform, dont get me wrong, but as one probably can tell by now this is heavily influenced by frustration, aswell as trying to figure out what in the goddamn hell the developers was thinking when presented with the feature request "we need to be able to set our own DNS server", and then landed on, well this.
This concludes my rant. Hopefully this saves someone days upon days of trying to solve the greates mystery of the world; How to update the DNS server in OpenWRT.

More replies
More replies

I'd recommend to following this guide to setup encrypted DNS, to make sure you receive what you are asking for: https://medium.com/@harriebird/implement-dns-over-tls-on-openwrt-20b7026a9b6c

[deleted]
•

I'm far from an expert but I recently came across the samequestion...

The annoyring thing is that there are different options and they will vary on your customizations. Overall, I found the easiest, most reliable and least hassle method for a basic home wireless router was using the luci-app-https-dns-proxy.

Firstly, it keeps the upstream DNS as a bootstrap so that is pretty useful to avoid weirdness with adding extra variables to the chain.

Then, while technically DoT is preferred over DoH... well DoH just skips past all the annoying questions you might ask yourself about whether your DNS is being highjacked or blocked.

Compared to DoT there is less to debug if there is a connection problem, because using DoH actually allows your router to mitigate some upstream meddling than can cause problems at home.

I recommend quad9 instead of google though, but it is easy to change and queickly see the results with the luci-app.

More replies

You have to set custom DNS on your LAN interface. DHCP on LAN interface will serve those IPs to each client when connected