My technical journal.

Maybe useful, maybe not.
posts - 105 , comments - 45 , trackbacks - 0

Sunday, February 2, 2020

Setting DNS server addresses with Control Panel and Powershell

In my test environment, which isn't optimally configured, new installations can't find the domain as they are not pointing to the domain's DNS. Instead they default to the hub which forwards all DNS requests to the Default Gateway and the Internet.

I can fix this on a case-by-case basis through the Control Panel:

  1. Go to 'Control Panel \ Network and Internet \ Network Connections'
  2. Right-click the network adapter and choose 'Properties'
  3. Select "Internet Protocol version 4 (TCP/IPv4) and click 'Properties'
  4. On the General tab, select "Use the following DNS server addresses:"
  5. For "Preferred DNS server:", enter the IP address of the DNS machine for the test domain
  6. For "Alternate DNS server:", enter the IP address of the Internet router
  7. Click 'OK', then 'Close'
Alternatively, if there is no Desktop Experience (i.e. Core) then the following Powershell command will do the same thing:

Set-DNSClientServerAddress –interfaceIndex 15 –ServerAddresses (“”,””)

You may need to find the interface index first with Get-NetIPInterface:

ifIndex InterfaceAlias                  AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp     ConnectionState PolicyStore
------- --------------                  ------------- ------------ --------------- ----     --------------- -----------
1       Loopback Pseudo-Interface 1     IPv4            4294967295              75 Disabled Connected       ActiveStore
45      Local Area Connection* 27       IPv4                  1500              25 Disabled Disconnected    ActiveStore
32      Ethernet 8                      IPv4                  1500               5 Enabled  Disconnected    ActiveStore
23      Bluetooth Network Connection 7  IPv4                  1500              65 Enabled  Disconnected    ActiveStore
15      WiFi                            IPv4                  1500              50 Enabled  Connected       ActiveStore


Posted On Sunday, February 2, 2020 8:59 PM | Comments (0) |

Powered by: