-
Notifications
You must be signed in to change notification settings - Fork 88
DnsServerAddress
dscbot edited this page Jun 7, 2024
·
6 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
InterfaceAlias | Key | String | Alias of the network interface for which the DNS server address is set. | |
AddressFamily | Key | String | IP address family. |
IPv4 , IPv6
|
Address | Write | StringArray[] | The desired DNS Server address(es). Exclude to enable DHCP. | |
Validate | Write | Boolean | Requires that the DNS Server addresses be validated if they are updated. It will cause the resource to throw a 'A general error occurred that is not covered by a more specific error code.' error if set to True and specified DNS Servers are not accessible. |
This resource is used to control a node's DNS Server address(s).
Configure DNS Server for the Ethernet adapter.
Configuration DnsServerAddress_Config
{
Import-DscResource -Module NetworkingDsc
Node localhost
{
DnsServerAddress DnsServerAddress
{
Address = '127.0.0.1'
InterfaceAlias = 'Ethernet'
AddressFamily = 'IPv4'
Validate = $true
}
}
}
Configure primary and secondary DNS Server addresses on the Ethernet adapter.
Configuration DnsServerAddress_PrimaryAndSecondary_Config
{
Import-DscResource -Module NetworkingDsc
Node localhost
{
DnsServerAddress PrimaryAndSecondary
{
Address = '10.0.0.2','10.0.0.40'
InterfaceAlias = 'Ethernet'
AddressFamily = 'IPv4'
Validate = $true
}
}
}
Enabling DHCP for the IPv4 Address and DNS on the adapter with alias 'Ethernet'.
Configuration DnsServerAddress_EnableDHCP_Config
{
Import-DscResource -Module NetworkingDsc
Node localhost
{
NetIPInterface EnableDhcp
{
InterfaceAlias = 'Ethernet'
AddressFamily = 'IPv4'
Dhcp = 'Enabled'
}
DnsServerAddress EnableDhcpDNS
{
InterfaceAlias = 'Ethernet'
AddressFamily = 'IPv4'
}
}
}
- DefaultGatewayAddress
- DnsClientGlobalSetting
- DnsConnectionSuffix
- DnsServerAddress
- Firewall
- FirewallProfile
- HostsFile
- IPAddress
- IPAddressOption
- NetAdapterAdvancedProperty
- NetAdapterBinding
- NetAdapterLso
- NetAdapterName
- NetAdapterRdma
- NetAdapterRsc
- NetAdapterRss
- NetAdapterState
- NetBios
- NetConnectionProfile
- NetIPInterface
- NetworkTeam
- NetworkTeamInterface
- ProxySettings
- Route
- WaitForNetworkTeam
- WinsServerAddress
- WinsSetting