Skip to content

MacOS: search domains are not applied (redirect_dns is false) #358

@rhuitl

Description

@rhuitl

This is similar to or even the same as #242, but redirect_dns is false in my case.

The server pushes search domains. Probably for compatibility reasons with some clients, it pushes it as both DOMAIN and DOMAIN-SEARCH:

[dhcp-option] [DOMAIN] [int.example.com]
[dhcp-option] [DOMAIN-SEARCH] [int.example.com]

On MacOS, split-DNS is enabled, so

server.domains.push_back({domain});
adds the search domains to server.domains (and not server.search_domains).
CF::dict_set_obj(info->ovpn.mod, "SupplementalMatchDomains", config.resolve_domains());
sets these as SupplementalMatchDomains but the next line excludes them from being search domains via SupplementalMatchDomainsNoSearch=1.

if (CF::array_len(config.search_domains))
finds an empty list, so no domain is added as a search domain.

When I comment out the code that sets SupplementalMatchDomainsNoSearch, the search domain is added as expected, and I can resolve names without having to type the FQDN. Alternatively, moving

search_domains.push_back({domain});
out of the else block, so it always adds the domain to the search list, achieves the desired effect.

Could you please review if the current behavior is expected? It means that MacOS users will not have the search domains set up, at all. There are many threads on various forums on the web where people face this problem. Tunnelblick, on the other hand, supports this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions