Multiple domain search for Windows clients

  • Hi,

    We are successfully running the OpenVPN server in pfSense for over 2 years. This has always been an issue but not something we looked into closely until now. Our VPN clients are using Ubuntu/Debian, MacOS and Windows. We have 3 subdomains in our internal network which should be reachable via domain-search when connected to the VPN. For this we added a custom config for OpenVPN:

    push "dhcp-option DOMAIN";
    push "dhcp-option DOMAIN";
    push "dhcp-option DOMAIN";
    push "dhcp-option DOMAIN-SEARCH";
    push "dhcp-option DOMAIN-SEARCH";
    push "dhcp-option DOMAIN-SEARCH";

    The DOMAIN-SEARCH options work fine for Ubuntu/Debian and MacOS. All hostnames are reachable using the short hostname. For Windows however, DOMAIN-SEARCH does not work at all, therefore there we are using DOMAIN. The problem with this, on Windows, is that only the last line of the DOMAIN it used. Only short hostnames in are reachable.

    We are looking to find a solution to this and it seems Windows would support the following format:

    push "dhcp-option DOMAIN;;";


    However, I am unable to test this scenario because pfSense uses the semi-colon as an EOL delimiter, therefore it splits this line in 3 separate lines in server.conf. I did try to escape the semi-colons with no success.

    That being said, I have 2 questions:

    1. Does anyone know a good way of specifying multiple search domains for Windows with OpenVPN?
    2. Any idea how the semi-colons could be escaped so that pfSense doesn't split the line?


  • No else here using OpenVPN on Linux and Windows clients has seen this issue?

  • LAYER 8 Global Moderator

    So are these windows machines part of your domain?  If so that is where you would push out the search domains via gpo..

  • LAYER 8 Rebel Alliance

    Same issue here and searching for some solution.


  • under the OpenVPN Server configuration section, the pfSense GUI allows you to specify a "DNS default domain" value to be used by the OpenVPN clients, so that they will resolve hostnames appending that domain name as a primary DNS suffix. This field on the GUI translates to the DHCP option 15.

    The DHCP option that allows to specify a domain search list (that is, one or more domains) is the option 119. The DHCP client of MS Windows (at least up to Windows 7, included) implements the DHCP option 15 but does not implement the DHCP option 119, so it will only accept the (single) domain specified in the "DNS default domain" field. It's a limitation of the Windows DHCP client. That OS itself has no such limitation, because you can specify multiple DNS search suffixes on Windows clients joined to an AD using GPO's. Take a look at this link,


  • Sorry for necro-posting, but wanted to add some information here since this is a thread that came up as a search result.

    Windows 10 has added support for DHCP option 119 at least as of the April 2018 build (1803). However, I had to use the OpenVPN Connect application on Windows in order to take advantage of this. I am now able to consistently resolve two connection-specific domains via a single OpenVPN session.

  • thanks for your update. OpenVPN 2.5 will allow to pass a domain search list to Windows clients, see (search "Support setting DHCP search domain")

Log in to reply