Dns server on openwrt

Good morning community, how are you? I hope well, today I come with a couple of doubts regarding the operation of the firmware. Is there a way to override the router's DNS server function with openwrt? The 8 hosts that I have in my house, servers, smart TVs, Wi-Fi clients, desktops and laptops use the router as a DNS server. Is there a way to override the router's DNS function and have the hosts go directly to my two local DNS servers to make their DNS queries? Thank you very much in advance.

In what way is the firmware malfunctioning?

its running 23.05.4 for example,my smart tv,send the query to the router and this one response with the dns cache. y anulated that cache.since that...the router send the query to the dns. what im trying to do,is force the tv to ask the query directly to the dns not passing on the router. is it possible?

I am not a native speaker but it looks like things got lost in translation.

You have doubts about the operation of the firmware, but the firmware by default hands out the routers address as DNS server because that is where the DNS server (DNSMasq) is listening.

You can change that default behaviour of course as described in the wiki:
https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#dhcp_options

1 Like

Here's an example:

You can either tell the clients to use your DNSs, using DHCP options, or upstream queries from the OpenWrt router to your DNS. Which method do you prefer?

thanks mate i configured that. i`ll see if it works.

1 Like

Make sure you have the clients obtain a new lease after saving and applying!

what i was trying to do is make the clients go directly to both local dns i have 2 unound+adguard-home running on my network. without having to use in those hosts a static ip adress.

i'm wondering if what you post,is there ascendent dhcp server?

I don't understand the question.

in the image you posted....that was configuration to an ascendent dhcp server? or dns? i was looking that says "dhcp server that advertise different dns servers to clients"

This is DHCP Server configuration for DHCP Option No. 6 ("Domain Server" or DNS).

6,<DNS_Server_1>,<DNS_Server_2>

This setting will "override the router's DNS function and have the hosts go directly to my two local DNS servers to make their DNS queries" by transmitting the listed DNS servers to the hosts in their DHCP Lease instead of the router's IP.

I hope this answers your question.

2 Likes

ok thanks for replying! i will try and see if ir works.

1 Like

hello again,how are you? i did what you posted,when i make a nslookup....routers dns keeps answering the querys. even thoug resolve.conf is configurated with my local dns. it`s very wired.any idea?

thanks a lot.

root@AC-1750-OpenWrt:~# cat /tmp/resolv.conf.d/resolv.conf.auto
# Interface WG_server
nameserver 1.1.1.1
# Interface lan
nameserver 192.168.0.176
nameserver 192.168.0.193
# Interface wan
nameserver 192.168.0.193
nameserver 192.168.0.176

Why are you testing the router?

Test the hosts.

?

Did you do this?

It is located by browsing to:

Network > Interfaces > LAN > DHCP Server > Advanced Settings

yes i did that. but i found the solution, i disable the dns function of dnsmasq with this code
service dnsmasq stop
uci set dhcp.@dnsmasq[0].localuse="0"
uci set dhcp.@dnsmasq[0].port="0"
uci commit dhcp
service dnsmasq start
and my hosts go directly to my local dns. so we can close the topic.

thakns to all for helping me. have a nice day!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.