• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Think PowerShell

Think PowerShell

PowerShell for IT Pros

  • About
    • Who I Am
    • Why I Blog
    • Privacy Policy
  • Resources
    • More PowerShell Sites
    • Post Series Index
  • Get Help
  • Show Search
Hide Search

DNS

Change DNS Servers for Computers with Static IP Addresses

Aaron Rothstein · March 27, 2017 · 8 Comments

DNS Server Settings Screenshot
Update DNS servers using PowerShell.

Easily change DNS servers for computers with static IP addresses using PowerShell. Run locally or remote.

Changing DNS servers

Recently I provisioned new domain controllers as part of a migration from a 2008 R2 Active Directory forest to a 2016 Active Directory forest. Like the existing 2008 R2 domain controllers, the new domain controllers are configured as AD integrated DNS servers and will be the primary and secondary DNS servers used on the internal network.

Changing DNS servers for clients using DHCP is a trivial matter; just update Option 6 for the DHCP scope with the new name server IP addresses and restart the client (or wait until they renew their lease).

However if you are like a lot of environments, you have Windows servers and maybe even workstations configured with static IP addresses and static DNS servers. How can you systematically update these configurations?

[Read more…] about Change DNS Servers for Computers with Static IP Addresses

PowerShell Replacement for ‘nslookup’

Aaron Rothstein · March 2, 2016 · 9 Comments

nslookup options screenshot

The fourth post in my PowerShell Beginner series, “Daily Tasks, The PowerShell Way“. Use PowerShell’s Resolve-DnsName cmdlet as a more powerful successor to ‘nslookup’.

What’s in a name?

Any seasoned IT Pro knows that the names we see for servers or in web URLs ultimately need to “resolve” or translate to a numerical IP address. Computers perform this resolution using a worldwide network of Domain Name System (DNS) servers. When your browser attempts to go to https://thinkpowershell.com, your computer will send a query to a DNS server with the hostname “thinkpowershell.com”, and the DNS server will return the IP address of the server hosting the website. Your DNS server will likely have to forward a query to other DNS servers to get the correct IP address.

nslookup (name server lookup) is a command line tool that has been around for years for performing this lookup activity on demand. You can specify the hostname or website domain name for which you want to “lookup” the IP address. Additionally, with the second positional parameter you can specify the IP address of a specific DNS server you want to query. It is a helpful tool, but it only returns CNAME , A, and AAAA record information, and not as a script-usable object.

[Read more…] about PowerShell Replacement for ‘nslookup’

PowerShell Replacements for ‘ipconfig’ Client DNS Functions

Aaron Rothstein · February 29, 2016 · Leave a Comment

Screenshot of ipconfig DNS functions.

The third post in my PowerShell Beginner series, “Daily Tasks, The PowerShell Way“. Use PowerShell to replace ipconfig‘s /registerdns, /displaydns, and /flushdns functions, and use for both local and remote computers.

ipconfig: a longtime member of the IT Pro toolbox

Much like ping, ipconfig was a frequently used command line tool for IT Pros. Whether it was getting assigned IP information, releasing and renewing DHCP leases, or investigating DNS client issues, ipconfig was quick go to troubleshooting tool. However, recent versions of Windows and PowerShell have added easy to use cmdlets to replace some of these functions. This post will take a look at the cmdlets related to the DNS client.

[Read more…] about PowerShell Replacements for ‘ipconfig’ Client DNS Functions

Primary Sidebar

Aaron

Think PowerShell

Copyright © 2025 · Monochrome Pro on Genesis Framework · WordPress · Log in