Answered Get DNS IP remotely - Script

  • Wednesday, December 05, 2012 3:35 PM
     
     

    Hello,

    I need an script to get the DNS IP (the primary one) of my PCs remotely, for example using "psexec" command.
    Is there any way to get it remotely ?
    Thanks in advance,
    Roger JC

All Replies

  • Wednesday, December 05, 2012 3:41 PM
    Moderator
     
     Answered

    Hi,

    Why do you need to do it? Are the computers not getting assigned DNS server IP addresses via DHCP?

    Bill

  • Wednesday, December 05, 2012 4:34 PM
     
     

    Hello,

    I need an script to get the DNS IP (the primary one) of my PCs remotely, for example using "psexec" command.
    Is there any way to get it remotely ?
    Thanks in advance,
    Roger JC

    The DNS IP?  What is that.

    So you can get a better idea of why your request is vague and untechnical read teh following.

    If your computer is registered in DNS then a simple ping will get you the DNS IP.

    IF you are talking about a DNS lookup of a computer by name the use NSLOOKUP

    NSLOOKUP <enter>
    somepcname

    This will return the IP from the current DNS resolver for the requested name.

    If you want a direct remote lookup then use WMI which can remotely query a DNS server for irts full records.  You must be an admministrator on the DNS server to do this.

    DNSCMD can remotely retrieve DNS records.


    ¯\_(ツ)_/¯