My technical journal.

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

My Links

News

Tag Cloud

Article Categories

Archives

Post Categories

Image Galleries

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 (“192.168.0.1”,”10.0.0.2”)

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



References


Print | posted on Sunday, February 2, 2020 8:59 PM |

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

Powered by: