none
Powershell DNS Query RRS feed

  • Question

  • Hi all,

    Can anyone help or give me an example for completing a DNS query across multiple DNS servers on different domains? For example server A is on DOMAIN A with a DNS server of 10.1.1.1 and Server B is on DOMAIN B with a DNS server of 10.1.1.2. The two domains can communicate with each other. What i would like to do is to complete an NSLOOKUP to Server A and have it check both DNS servers and show the results.

    Thanks in advance

    -Gaz

    • Moved by Bill_Stewart Saturday, July 5, 2014 3:18 PM Off-topic post
    Tuesday, March 11, 2014 1:23 PM

Answers

  • Not a scripting question.  NSLOOKUP is a system utility.  You shoul post in the forum for you OS on hos to use utilityprograms.

    NSLOOKUP has nothing to do with Active Directory.  It is a general purpose client utility.

    Start by reading the help carefully as it answers your exact question:

    NSLOOKUP /?


    ¯\_(ツ)_/¯

    • Marked as answer by gazzamon Thursday, November 17, 2016 3:01 PM
    Tuesday, March 11, 2014 1:27 PM

All replies

  • Not a scripting question.  NSLOOKUP is a system utility.  You shoul post in the forum for you OS on hos to use utilityprograms.

    NSLOOKUP has nothing to do with Active Directory.  It is a general purpose client utility.

    Start by reading the help carefully as it answers your exact question:

    NSLOOKUP /?


    ¯\_(ツ)_/¯

    • Marked as answer by gazzamon Thursday, November 17, 2016 3:01 PM
    Tuesday, March 11, 2014 1:27 PM
  • Hi and thanks for the reply.

    I may have been a little unclear in my question. I am looking for a way to do this in powershell. Below is a portion of the script that i use to query DNS however i cannot seem to figure out how to query against multuple DNS servers in different domains or if it is even possible.

    $ping = new-object System.Net.NetworkInformation.Ping
    $Reply = $ping.send($strComputer)
    $name = [System.Net.Dns]::GetHostByName($strComputer).HostName
    $a = nslookup($strComputer)

    Tuesday, March 11, 2014 1:35 PM
  • It is still a utility.  Just read the help and apply.

    The Net query will query all registered domains.  It is not domain specific.

    If you are trying to check DNS server records then use WMI.

    What are you looking for?  Are you trying to get the IP?


    ¯\_(ツ)_/¯

    Tuesday, March 11, 2014 1:39 PM
  • Tuesday, March 11, 2014 1:47 PM