OPNsense Forum

English Forums => General Discussion => Topic started by: hushcoden on February 12, 2023, 06:24:42 PM

Title: DNS servers priority
Post by: hushcoden on February 12, 2023, 06:24:42 PM
Which DNS server has higher priority, in other words which one the client is going to pick up, the one I specify in Services -> DCHPv4 -> LAN or in Services -> DCHPv4 -> LAN -> Client ?

Tia.
Title: Re: DNS servers priority
Post by: bartjsmit on February 12, 2023, 06:37:06 PM
First entry is used first.

RFC says: https://www.rfc-editor.org/rfc/rfc2132 section 3.7 and 3.8

Bart...
Title: Re: DNS servers priority
Post by: hushcoden on February 12, 2023, 07:12:54 PM
I'm sorry I don't understand what First entry is used first means...

The reason I'm asking is that I did specify the DNS IP address for my 20 clients in Services -> DCHPv4 -> LAN -> DNS servers, but now 2 of those clients need to point to a different DNS server, so I thought I could use the DNS Server entry in Services -> DCHPv4 -> LAN -> "client" -> DNS servers to override, is it the right way ?
Title: Re: DNS servers priority
Post by: bartjsmit on February 12, 2023, 08:24:03 PM
Services, DHCPv4, <Interface Name> has two lines for DNS servers (10th and 11th option on the page). The top one (first entry) takes precedence over the next one down (second entry). In other words - they don't load balance, round-robin or otherwise. It is a simple active/passive list. As long as your top server responds to DNS queries within the timeout period, the bottom server will never be used.

If you set DHCP reservations, any settings per client will override the default. Have you tested?
Title: Re: DNS servers priority
Post by: hushcoden on February 14, 2023, 06:38:20 PM
Yes, I was referring to a client with DHCP reservation and yes the DNS server of a client 'wins' !