How to define a custom port when push "dhcp-option DNS"?

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
houmie75
OpenVPN Power User
Posts: 72
Joined: Wed Jul 22, 2020 7:46 pm

How to define a custom port when push "dhcp-option DNS"?

Post by houmie75 » Sun Nov 21, 2021 9:29 am

Hello,

I have set my private DNS server to be reached over port 65. How can I set the port accordingly on server.conf to be pushed down to the clients??

Code: Select all

push "dhcp-option DNS [2a01:4f8:1c17:7709::1]:65"
push "dhcp-option DNS 10.8.0.1:65"
Thanks,

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: How to define a custom port when push "dhcp-option DNS"?

Post by TinCanTech » Sun Nov 21, 2021 5:14 pm

Openvpn does not configure your DNS Service, at all. It certainly doesn't push port numbers.

houmie75
OpenVPN Power User
Posts: 72
Joined: Wed Jul 22, 2020 7:46 pm

Re: How to define a custom port when push "dhcp-option DNS"?

Post by houmie75 » Sun Nov 21, 2021 5:37 pm

Maybe this is a misunderstanding. But this configuration is certainly possible. See here: https://openvpn.net/community-resources ... o-clients/

The server pushes the DNS settings to the client to utilise.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: How to define a custom port when push "dhcp-option DNS"?

Post by TinCanTech » Sun Nov 21, 2021 6:37 pm

All Openvpn actually does is to push an IP address, what happens to that is different for all clients.

Windows uses the PDHCP Server to configure your adaptor, Linux must use a script, for the time being.

houmie75
OpenVPN Power User
Posts: 72
Joined: Wed Jul 22, 2020 7:46 pm

Re: How to define a custom port when push "dhcp-option DNS"?

Post by houmie75 » Sun Nov 21, 2021 7:06 pm

Ok great. Is there a way to also specify the port in addition to the IP address?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: How to define a custom port when push "dhcp-option DNS"?

Post by TinCanTech » Sun Nov 21, 2021 7:53 pm

houmie75 wrote:
Sun Nov 21, 2021 7:06 pm
Is there a way to also specify the port in addition to the IP address?
You can specify it as you have already done:
houmie75 wrote:
Sun Nov 21, 2021 9:29 am

Code: Select all

push "dhcp-option DNS 10.8.0.1:65"
but none of the services that use this option know how to use the Port parameter.


houmie75
OpenVPN Power User
Posts: 72
Joined: Wed Jul 22, 2020 7:46 pm

Re: How to define a custom port when push "dhcp-option DNS"?

Post by houmie75 » Sun Nov 21, 2021 8:04 pm

Ah I see. This only works on Linux clients though. Won't be possible on iOS.

No worries, I have to keep the port as standard then.

Thanks

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: How to define a custom port when push "dhcp-option DNS"?

Post by TinCanTech » Sun Nov 21, 2021 8:18 pm

What difference does it make which port DNS uses ?

Post Reply