An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# DNSSuffix

[![PSGallery Version](https://img.shields.io/powershellgallery/v/DNSSuffix.png?style=for-the-badge&label=PowerShell%20Gallery)](https://www.powershellgallery.com/packages/DNSSuffix/) [![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/DNSSuffix.png?style=for-the-badge&label=Downloads)](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:

![Set DNS Suffix](./images/system1.png)

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.