Learn to perform a DNS backup and restore
Records are the core of DNS
A DNS server answers queries called DNS lookups from other computers on the network. Computers send a DNS query to the DNS server, which returns the relevant information requested or forwards the request to another DNS server that better answers the query. There are more than 90 DNS record types, but the list below shows the eight most common ones.
An A DNS record is the most common. The A is short for address. These A records resolve host names to IP addresses. This request type is known as a forward lookup.
My lab’s domain is called mk.lab and has a domain controller named DC01 with an IP address of 192.168.15.20. In DNS, there is an A record with this host information.
The DNS Manager console provides a graphical representation of DNS records. Notice on the left-hand side, we have the domain name mk.lab. The right panel shows the records in the mk.lab zone. You can see the entry for DC01, the record type and the IP address associated with DC01.
To query this information using PowerShell, use the following command:
Resolve-DnsName DC01.mk.lab
Name Type TTL Section IPAddress
—- —- — ——- ———
dc01.mk.lab A 211538 Answer 192.168.15.20
The opposite of an A record is a pointer (PTR) record. The previous command is an example of a forward lookup: I provided the name, and DNS returned the IP address. PTR records work in reverse: I provide an IP address, and DNS returns the host name. This is called a reverse lookup.
To look up PTR records with PowerShell, run the following command:
Resolve-DnsName 192.168.15.20 | ft –AutoSize
Name Type TTL Section NameHost
—- —- — ——- ——–
20.15.168.192.in-addr.arpa. PTR 210407 Answer dc01
20.15.168.192.in-addr.arpa. PTR 210407 Answer dc01.mk.lab
The last record type I will cover is a canonical name (CNAME) record that is used to reference a host with an alias. A CNAME record points to an A record.
To understand how CNAME works, let’s say I have a server called AZBUILD01 in my domain. To reach the server with the name MyTestServer, you can create a CNAME record for MyTestServer that refers to the AZBUILD01 DNS record.
PowerShell can look up all types of DNS records. The following PowerShell command queries the MyTestServer alias and outputs the DNS information.
Resolve-DnsName mytestserver.mk.lab –Server dc01
Name Type TTL Section NameHost
—- —- — ——- ——–
mytestserver.mk.lab CNAME 3600 Answer AZBuild01.mk.lab
Name : AZBuild01.mk.lab
QueryType : A
TTL : 1200
Section : Answer
IP4Address : 192.168.15.25