How to use Powershell to register a new DNS entry

Forums: 


To register a new DNS entry using PowerShell, you can use the Add-DnsServerResourceRecord cmdlet from the DnsServer module.

Here's an example:

Import-Module DnsServer
Add-DnsServerResourceRecord -Name "hostname" -ZoneName "example.com" -A -IPv4Address "192.168.1.100" -TimeToLive 00:10:00

In this example, a new A record is being added for "hostname" with an IP address of "192.168.1.100". The TimeToLive is set to 10 minutes.

Note: To use the DnsServer module, you'll need to be running PowerShell as an administrator on a machine that has the DNS Server role installed.