DNS records

The DNS server in Windows Server supports a very wide variety of resource records, the ones that are used the most  are:

  • A An IPv4 host address record.
  • AAAA An IPv6 host address record.
  • CName A canonical name record. The CName record allows the use of more than one resource record to refer to a single host.
  • MX A Mail Exchanger record. The MX record identifies the email server for a domain. There can be multiple MX records for a domain, and they are used in order of precedence.
  • NS A Name Server record. The NS record identifies a name server for the domain. There can be multiple NS records in a domain.
  • PTR A pointer record. The PTR record is a reverse lookup record that translates an IP address into a host name. PTR records can be IPv4 or IPv6 addresses.
  • SOA A Start of Authority record. The SOA record is a version number record identifying the version number of the DNS zone.
  • SRV A Service record. The SRV record identifies the host name and port number of servers for the specified service.

Powershell Add-DnsServerResourceRecord and Set-DnsServerResourceRecord


Add-DnsServerResourceRecordA -ZoneName “alastairhill.co.uk” -Name trey-srv-14 -IPv4Address -CreatePtr


Add-DnsServerResourceRecordAAAA -ZoneName “alastairhill.co.uk” -Name trey-srv-14 -IPv6Address 2001:db8::0e -CreatePtr


Add-DnsServerResourceRecordCNAME -ZoneName “alastairhill.co.uk” -Name dc1 -HostNameAlias trey-dc-02.alastairhill.co.uk


Add-DnsServerResourceRecordMX -ZoneName “TreyResearch.net” -Name “.” -MailExchange trey-srv-12.treyresearch.net -Preference 10


Add-DnsServerResourceRecordPtr -ZoneName 10.168.192.in-addr.arpa -PTR -Name “14” -PtrDomainName “trey-srv-14.treyresearch.net”


SRV Record
Add-DnsServerResourceRecord -ZoneName “TreyResearch.net” -Name _nntp._tcp -SRV -DomainName “trey-edge-1.treyresearch.net” -Port 119 -Priority 0 -Weight 0 -PassThru

NS Record
Add-DnsServerResourceRecord -ZoneName “TreyResearch.net” -NS -Name “.” -NameServer trey-srv-12.treyresearch.net -PassThru

Leave a Reply