template<typename REG, typename NETAPI>
class openvpn::TunWin::Dns< REG, NETAPI >
Manage DNS search suffixes for Windows.
- Template Parameters
-
REG | Registry abstraction class to use |
NETAPI | Network related Win32 API class to use |
Definition at line 65 of file dns.hpp.
template<typename REG , typename NETAPI >
static std::pair< typename REG::Key, bool > openvpn::TunWin::Dns< REG, NETAPI >::open_searchlist_key |
( |
| ) |
|
|
inlinestaticprivate |
Return the Key for the DNS domain "SearchList" value.
It also returns a boolean value, telling whether a SearchList already exists under the returned registry key.
- Returns
- std::pair<REG::Key, bool> the search list key and a boolean telling if a list exists
Definition at line 86 of file dns.hpp.
template<typename REG , typename NETAPI >
static void openvpn::TunWin::Dns< REG, NETAPI >::remove_search_domains |
( |
const std::string & |
itf_name, |
|
|
const std::string & |
domains |
|
) |
| |
|
inlinestatic |
Remove domain suffix(es) from the system.
If a search list exists, it is restored to the previous state. The adapter domain suffix is also emptied. And temporary values from the registry are removed if they are no longer needed.
- Parameters
-
itf_name | alias name of the interface the suffix is removed from |
domains | a comma separated list of domain names to be removed |
Definition at line 354 of file dns.hpp.
template<typename REG , typename NETAPI >
static void openvpn::TunWin::Dns< REG, NETAPI >::reset_search_domains |
( |
typename REG::Key & |
list_key | ) |
|
|
inlinestatic |
Reset the DNS "SearchList" to its original value.
Looks for "OriginalSearchList" value as the one to reset to. If it doesn't exists resets to the empty value, which is interpreted as no search list.
- Parameters
-
list_key | key in the registry to reset the values under |
Definition at line 331 of file dns.hpp.
template<typename REG , typename NETAPI >
static void openvpn::TunWin::Dns< REG, NETAPI >::set_search_domains |
( |
const std::string & |
itf_name, |
|
|
const std::string & |
domains |
|
) |
| |
|
inlinestatic |
Add DNS search domain(s)
Extend the list of DNS search domains present on the system. If domains is only a single domain (no comma) and there currently is no search list defined on the system, a interface specific domain suffix is used instead of generating a new search list.
- Parameters
-
itf_name | alias name of the interface a single domain is set for |
domains | a comma separated list of domain names |
Definition at line 285 of file dns.hpp.
template<typename REG , typename NETAPI >
Initial value:{
LR"(SOFTWARE\Policies\Microsoft\WindowsNT\DNSClient)",
LR"(System\CurrentControlSet\Services\TCPIP\Parameters)"}
Registry locations the DNS search domains list can be stored in. When the first key exists and it has domains in the "SearchList" value, then these GPO provided domains will be used as suffixes, otherwise the manually created ones in the second key will be used (if they exist).
Definition at line 73 of file dns.hpp.