-
Notifications
You must be signed in to change notification settings - Fork 90
HostsFile
dscbot edited this page Apr 14, 2025
·
7 revisions
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| HostName | Key | String | Specifies the name of the computer that will be mapped to an IP address. | |
| Ensure | Write | String | Specifies if the hosts file entry should be created or deleted. |
Present, Absent
|
| IPAddress | Write | String | Specifies the IP Address that should be mapped to the host name. |
This resource is used to control entries on a the host file for a node.
Add a new host to the host file.
Configuration HostsFile_AddEntry_Config
{
Import-DSCResource -ModuleName NetworkingDsc
Node localhost
{
HostsFile HostsFileAddEntry
{
HostName = 'Host01'
IPAddress = '192.168.0.1'
Ensure = 'Present'
}
}
}Remove a host from the hosts file.
Configuration HostsFile_RemoveEntry_Config
{
Import-DSCResource -ModuleName NetworkingDsc
Node localhost
{
HostsFile HostsFileRemoveEntry
{
HostName = 'Host01'
IPAddress = '192.168.0.1'
Ensure = 'Absent'
}
}
}- DefaultGatewayAddress
- DnsClientGlobalSetting
- DnsClientNrptGlobal
- DnsClientNrptRule
- 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