Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PowerShell – Windows DNS Server Basics

Posted on May 11, 2018 By David Kittell
# Windows Version - Helps to know what version as some things change from one version to another.
(Get-WmiObject -class Win32_OperatingSystem).Caption

$ZN = "kittell.net"

# List DNS Forwarders - Where to go if DNS record not in this DNS server
Get-DnsServerForwarder

# Remove DNS Server Forwards
#Remove-DnsServerForwarder -IPAddress 8.8.8.8 -PassThru -Force
#Remove-DnsServerForwarder -IPAddress 9.9.9.9 -PassThru -Force
#Get-DnsServerForwarder

Add-DnsServerForwarder -IPAddress 8.8.8.8 -PassThru

# List all records on DNS server
Get-DnsServerResourceRecord -ZoneName $ZN

# List only SOA records on DNS server
Get-DnsServerResourceRecord -ZoneName $ZN -RRType SOA | FL

# List Zone Delegation 
Get-DnsServerZoneDelegation -Name $ZN

# Setup Zone Delegation
Add-DnsServerZoneDelegation -Name $ZN -ChildZoneName "_msdcs" -NameServer "dns01.$ZN" -IPAddress 10.25.254.208 -PassThru -Verbose
Add-DnsServerResourceRecordA -ZoneName $ZN -TimeToLive 01:00:00 -AllowUpdateAny -Name "dns02"  -IPv4Address "10.25.254.209"

# Get full DNS server configuration
Get-DnsServer | Export-Clixml -Path "$HOME\Desktop\DnsServerConfig.xml"
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code DNS PowerShell Windows Windows Server

Post navigation

Previous post
Next post

Related Posts

LDAP Dates Converted

Posted on July 25, 2013October 26, 2015

Dates that look like 127524839567199000 (pwdLastSet, accountExpires, lastLogonTimestamp, etc.) IF( B16>0 ,B16/864000000000 – 109205 ,"" ) Example: 130186556607343750 converts to 40921.80861 40921.80861 in Excel with cell formatting of Date/Time will show as January 13th, 2012 7:24 PM Dates that look like 20050210223453.0Z (whenChanged) DATEVALUE( CONCATENATE( (LEFT(TRIM(B9),4)) ,"-" ,(RIGHT(LEFT(TRIM(B9),6),2)) ,"-" ,RIGHT(LEFT(TRIM(B9),8),2)…

Read More

UNIX Bash – Get Latest File Name Based On DateTime

Posted on July 7, 2016

Working on a backup and restore script I often need only to know what the latest backup/archive file is, this command helps you learn that. ls -ltr | tail -1 |cut -d’ ‘ -f10 All information on this site is shared with the intention to help. Before any source code…

Read More

Trim Function

Posted on August 8, 2013October 26, 2015

–FOR SQL SERVER 2000: CREATE FUNCTION dbo.TRIM(@string VARCHAR(8000)) RETURNS VARCHAR(8000) BEGIN RETURN LTRIM(RTRIM(@string)) END GO –FOR SQL SERVER 2005: CREATE FUNCTION dbo.TRIM(@string VARCHAR(MAX)) RETURNS VARCHAR(MAX) BEGIN RETURN LTRIM(RTRIM(@string)) END GO Source: http://blog.sqlauthority.com/2007/04/24/sql-server-trim-function-udf-trim/ Originally Posted on August 8, 2013Last Updated on October 26, 2015 All information on this site is shared…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
©2025 David Kittell | WordPress Theme by SuperbThemes