Quantcast
Channel: Geekswithblogs.net
Viewing all articles
Browse latest Browse all 6441

Setting DNS server addresses with Control Panel and Powershell

$
0
0

Originally posted on: http://geekswithblogs.net/Plumbersmate/archive/2020/02/02/setting-dns-server-addresses-with-control-panel-and-powershell.aspx

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



Viewing all articles
Browse latest Browse all 6441

Trending Articles