SetInterfaceDnsSettings function (netioapi.h)

Sets the per-interface DNS settings specified in the Settings parameter.

Syntax

NETIOAPI_API SetInterfaceDnsSettings(
  GUID                         Interface,
  const DNS_INTERFACE_SETTINGS *Settings
);

Parameters

Interface

Type: _In_ GUID

The GUID of the COM interface that the settings refer to.

Settings

Type: _In_ const DNS_INTERFACE_SETTINGS*

A pointer to a DNS_INTERFACE_SETTINGS-type structure that contains the DNS interface settings.

If this parameter points to a DNS_INTERFACE_SETTINGS structure, then the DNS_INTERFACE_SETTINGS::Version member must be set to DNS_INTERFACE_SETTINGS_VERSION1.

If this parameter points to a DNS_INTERFACE_SETTINGS_EX structure, then the version must be set to DNS_INTERFACE_SETTINGS_VERSION2.

If this parameter points to a DNS_INTERFACE_SETTINGS3 structure, then the version must to be set to DNS_INTERFACE_SETTINGS_VERSION3.

You must set appropriately all the desired options in the DNS_INTERFACE_SETTINGS::Flags field, and populate only the fields for which an option was set. You must zero out all other fields that don't have a corresponding option.

Return value

Returns NO_ERROR if successful. A non-zero return value indicates failure.

Requirements

Requirement Value
Minimum supported client Windows 10 Build 19041
Minimum supported server Windows 10 Build 19041
Target Platform Windows
Header netioapi.h (include Iphlpapi.h)
Library Iphlpapi.lib
DLL Iphlpapi.dll

See also