OPNsense Forum

English Forums => General Discussion => Topic started by: t.kayser on March 15, 2021, 08:18:37 PM

Title: Config third DNS in DHCP
Post by: t.kayser on March 15, 2021, 08:18:37 PM
Hi

Is there a way to configure a third DNS?

For our remote sides i would like to configure our two central DNS Servers, and the Firewall if the VPN ist down.

Can someone help meh here?   :)
Title: Re: Config third DNS in DHCP
Post by: sorano on March 16, 2021, 10:16:07 PM
I haven't tested but I think it should be possible with additional options in DHCP config.

DNS would be number 6 as per: https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml
Title: Re: Config third DNS in DHCP
Post by: t.kayser on March 22, 2021, 05:47:34 PM
Quote from: sorano on March 16, 2021, 10:16:07 PM
I haven't tested but I think it should be possible with additional options in DHCP config.

DNS would be number 6 as per: https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

Hi Sorano

thx for your reply

No luck so far, with: Numer= 6 or 5 / Type= IP adress or host / Value 10.101.1.1
Title: Re: Config third DNS in DHCP
Post by: xbb on April 04, 2021, 04:07:23 PM
Quote from: t.kayser on March 15, 2021, 08:18:37 PM
Is there a way to configure a third DNS?

Hi, I had the same issue.

I needed to configure 3 IPs:   192.168.0.10, 192.168.0.20, 192.168.0.1

You can use the additional options (ignore the 2 DNS fields)

Number: 6
Type: string
Value:
convert the numeric IPs to their hex value and concatenate them in the order you require, for example for the IPs I mentioned above the value is:
c0:a8:00:0a:c0:a8:00:14:c0:a8:00:01
Title: Re: Config third DNS in DHCP
Post by: eric01 on March 02, 2023, 10:03:43 AM
I had trouble understanding the instructions but now that I have it working, I wanted to help elucidate.

RFC 2132 (http://"https://www.rfc-editor.org/rfc/rfc2132.html") 3.8 says use option "6", minimum length is 4 octets, and length must always be a multiple of 4 [octets]. Servers should be listed in order of preference.

Convert the individual IP addresses you want with a Hex to IP converter

In the OPNsense GUI, under DHCPv4 configuration:

Troubleshooting

Thanks for the assistance @xbb et al. :)