fbpx

Category content:

PowerShell (DNS Record)

PowerShell (DNS Record)

How to check DNS records on domain by PowerShell?

To check the DNS records of a domain using PowerShell, you can use the Resolve-DnsName cmdlet. Here’s how you can do it:

  • Open PowerShell:
  • Launch PowerShell by searching for “PowerShell” in the Start menu
  • or by pressing Win + X and selecting “Windows PowerShell”
  • open “Windows PowerShell (Admin)”.

Run the command: In the PowerShell window, run the following command:

Powershell code:

Resolve-DnsName -Name example.com

Replace “example.com” with the actual domain you want to check. This command will query the DNS records for the specified domain.

View the results:

The command will display the DNS records associated with the domain.

The output will include information like the record type, record name, TTL (Time to Live), and the corresponding IP address or other data.

Here’s an example of the output you might see:

Name Type TTL Section IPAddress
—- —- — ——- ———
A     3600   Answer 192.0.2.123
MX 3600   Answer 10 mail.example.com
NS  86400 Answer ns1.example-dns.com
NS  86400 Answer ns2.example-dns.com

This output indicates that the domain “example.com” has an A record pointing to the IP address 192.0.2.123, an MX record specifying the mail server as “mail.example.com,” and two NS records specifying the authoritative name servers as “ns1.example-dns.com” and “ns2.example-dns.com.”

By using the Resolve-DnsName cmdlet with the appropriate domain name, you can obtain the DNS records for any domain.

 

If you want to see our learning about this topic, you can click here

 

Share :
407
keyboard_arrow_up