Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remotely retrieve DNS settings

Status
Not open for further replies.

bentley45

MIS
Jul 15, 2004
120
0
0
US
I need to find out the DNS settings on a remote computer. Is there a script to use or something in Computer Management I am not seeing?

W2k domain, w2k workstations.
Thanks!
 
Is the remote system configured for remote desktop?
A workstation?

A little more detail please...
 
Nope, it's just a regular domain member W2k workstation in another physical location. There are no remote admin tools installed, however I have domain admins privileges over the machine. Thanks!
 
Sorry but being thick, are you working from the remote computer or want to know without going to the remote system? and is the system logged onto the domain successfully?
 
The obvious answer is to have the user do an ipconfig/all at a command prompt...

I'm Certifiable, not certified.
It just means my answers are from experience, not a book.
 
Where I was going! Thanks for stealing my thunder! :)

I should get to the point more quickly...
 
I am logged onto a W2k workstation in the domain.

I need to know what DNS IP a remote W2k workstation is pointing to. When I say remote, I just mean it is in another building....it is physically connected to my network and logged onto the same Domain as my station.

I do not have a DNS problem, I just need to know what specific DNS IP it is pointing to. Thanks!
 
If it is in the same domain, with the same DHCP scope then simply run ipconfig /all in a cmd prompt and the results will be the same.
 
Not necessarily. If the local user manually changed the TCP/IP then it won't contain the DHCP scope info.

I'm Certifiable, not certified.
It just means my answers are from experience, not a book.
 
yep, but that wasn't implied in the text.

If it was remotely set and there is no means of remote desktop then there is no methodology that I can think of since you are asking a local computer to send out its settings via another workstation.

ipconfig /all
remote desktop
walk to the other building

I think those are your three choices :)
 
Wasn't implied in the text????

The OP is trying to determine DNS on a remote system. You advised him to run ipconfig/all locally and the result would be the same remotely. That's may or may not be true.

Perhaps I misunderstood, but that's how I read your post, and I was simply alerting the OP that he can't rely on what his DNS setting is because the remote user could possibly have modified the setting.

I'm Certifiable, not certified.
It just means my answers are from experience, not a book.
 
True. Sorry for any offence - none intended.

I stick to the final three though.
 
bentley45,

Do not rely upon what your DNS setting is on your local machine, it does not give you a valid answer as to what the DNS setting is on any remote system. The remote systems DNS could be different for reasons I've stated as well as other reasons not discussed here.



I'm Certifiable, not certified.
It just means my answers are from experience, not a book.
 
lander215 is absolutely correct - unless you can guarentee that both systems are using DHCP to acquire their IP addresses then you cannot, without remote desktopping the system, secure the local DNS settings.
 
Use WMI assuming the client will respond to it that is.......


On Error Resume Next
strComputer = "."
Set objWMIService = GetObject(_
"winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration")

For Each objItem in colItems
For Each strIPAddress In objItem.IPAddress
IpAddresses = Ipaddresses & vbCr & strIPAddress
Next
Info = "DNS servers in search order:"
For Each IP In ObjItem.DNSServerSearchOrder
Info = Info & vbcr & IP
Next

Info = Info & vbcr & vbcr & "WINS Servers:"
Info = Info & vbcr & "Primary: " & ObjItem.WINSPrimaryServer
Info = Info & vbcr & "Secondary: " & ObjItem.WINSSecondaryServer

msgbox ObjItem.Macaddress & " found using Win32_NetworkAdapterConfiguration" & vbCr & "IP Addresses bound To this card:" & IpAddresses & vbcr & Info
IpAddresses = ""
Info = ""

Next

 
Thanks for the responses. In answer to a couple of the questions, my users do not have access to run ipconfig on their computers. Also, my enterprise does not run DHCP, so just because my settings locally are one thing does not guarantee that another station is the same.

I found a similar script to the one offered by MisterNiceGuy and that served the purpose.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top