https://github.com/jdhitsolutions/dnssuffix
A set of PowerShell tools for managing the computer's primary DNS suffix.
https://github.com/jdhitsolutions/dnssuffix
dns-suffix powershell powershell-module registry
Last synced: 3 months ago
JSON representation
A set of PowerShell tools for managing the computer's primary DNS suffix.
- Host: GitHub
- URL: https://github.com/jdhitsolutions/dnssuffix
- Owner: jdhitsolutions
- License: mit
- Created: 2018-01-29T21:07:20.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2025-06-19T21:18:02.000Z (7 months ago)
- Last Synced: 2025-07-04T23:14:21.014Z (7 months ago)
- Topics: dns-suffix, powershell, powershell-module, registry
- Language: PowerShell
- Size: 34.2 KB
- Stars: 19
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: license.txt
Awesome Lists containing this project
README
# DNSSuffix
[](https://www.powershellgallery.com/packages/DNSSuffix/) [](https://www.powershellgallery.com/packages/DNSSuffix/)
## Installation
Install this module from the PowerShell Gallery.
```powershell
Install-PSResource -Name DNSSuffix
```
Even though the module isn't explicitly supported in PowerShell 7, there is no reason it shouldn't work. The module will require a Windows system.
## Overview
This PowerShell module has two simple commands that work with the registry to either get or set the primary DNS suffix of a computer. This is __not__ the value you can configure on a per network adapter configuration. Instead this is the setting you see when you go into Advanced System properties to change the computer name. When you click the More... button you get a form like this:

This value is maintained in the registry under `HKLM:\system\CurrentControlSet\Services\tcpip\parameters` where you must change the `Domain` and `NV Domain` properties. You can also configure whether to synchronize the DNS suffix with domain member ship changes. The commands in this module allow you to set and get those values using PowerShell remoting.
```powershell
PS C:\> Set-PrimaryDNSSuffix Company.pri -computername SRV1,SRV2 -SynchronizeSuffix
```
Modify the primary DNS suffix on remote computers to `Company.pri`.
```powershell
PS C:\> Get-PrimaryDNSSuffix -computername SRV1,SRV2
ComputerName : SRV1
Domain : Company.Pri
NV Domain : Company.Pri
SynchronizeSuffix : True
ComputerName : SRV2
Domain : Company.Pri
NV Domain : Company.Pri
SynchronizeSuffix : True
```
The changes should take effect immediately, but you may need to restart the computer for some applications to recognize the new DNS suffix.