What's new

dhcp-option DNS in OpenVPN's custom configuration field

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Intrepid2007

Regular Contributor
Hello forum members,

One of my OpenVPN connections is a Torguard VPN tunnel. The configuration comes without DNS servers so I have to specify my own DNS server.

So in the custom configuration field I added the following line:
dhcp-option DNS1.1.1.1

This works perfectly.

However I want like to specify a second DNS server so I just added a second line:
dhcp-option DNS 1.0.0.1

In the example above I use Cloudflare DNS servers but in reality I use alternative DNS servers for this particular OpenVPN connection.

Apparently it doesn't work that way, the client/server connection never connects....

Does the custom configuration field in OpenVPN allow to specify 2 DNS servers or is this not supported in OpenVPN at all?

Regards
 
It says right in the OpenVPN documentation that you can set additional DNS options.

--dhcp-option type [parm] ...

DNS addr -- Set primary domain name server IPv4 or IPv6 address. Repeat this option to set secondary DNS server addresses.

I did notice you're missing a space between the word DNS and 1.1.1.1 in your post. I assume that's NOT the case in the actual custom config field.

As long as you don't create a typo for the DNS setting, I don't see how any of this could prevent the OpenVPN client from at least connecting. How the actual specified DNS server(s) are handled from that point is an entirely different issue.
 
Last edited:
It says right in the OpenVPN documentation that you can set additional DNS options.

--dhcp-option type [parm] ...

DNS addr -- Set primary domain name server IPv4 or IPv6 address. Repeat this option to set secondary DNS server addresses.

I did notice you're missing a space between the word DNS and 1.1.1.1 in your post. I assume that's NOT the case in the actual custom config field.

As long as you don't create a typo for the DNS setting, I don't see how any of this could prevent the OpenVPN client from at least connecting. How the actual specified DNS server(s) are handled from that point is an entirely different issue.

The space in the example is indeed an error, in the actual router settings there is a space..

dhcp-option DNS 1.1.1.1
dhcp-option DNS 1.0.0.1

So it should be something like this?
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top