AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with Finding DNS and Gateway. Possible?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
steveiwonder



Joined: 16 Nov 2004
Posts: 83

PostPosted: Thu Feb 02, 2006 12:21 pm    Post subject: Help with Finding DNS and Gateway. Possible? Reply with quote

Hey peeps..
I need help with this...

I know how to get the IP address which isnt my problem...

I have limited access and i am restricted to alotta things on a certain network i use.

I need to be able to find the DNS Server , Default Gateway, and possibly the WINS server....

Is there and way i can get this information using AHK? I would be a great help if anyone knows how?
Thanks
Steve.


Last edited by steveiwonder on Thu Feb 02, 2006 12:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Thu Feb 02, 2006 12:27 pm    Post subject: Reply with quote

Since you are no newbie any more, you should first learn to give your topics a descriptive title.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kapege.de



Joined: 07 Feb 2005
Posts: 186
Location: Munich, Germany

PostPosted: Fri Feb 03, 2006 1:10 pm    Post subject: Reply with quote

Are you able to open the DOS-box? Then you might try a "ping" or "pingpath". That reveals the hops to a given destination. The first hop often is your router or a gateway.
_________________
Peter

Wisenheiming for beginners: KaPeGe (German only, sorry)
Back to top
View user's profile Send private message Visit poster's website
evl



Joined: 24 Aug 2005
Posts: 1238

PostPosted: Fri Feb 03, 2006 6:40 pm    Post subject: Reply with quote

Equally, at a dos prompt the following command can be used to find the dns server (using www.google.com as an example):

nslookup www.google.com

The first address line gives the dns server address and the 2nd line its IP.
Back to top
View user's profile Send private message
AgentSmith15



Joined: 06 May 2005
Posts: 37

PostPosted: Fri Feb 03, 2006 11:34 pm    Post subject: Reply with quote

WOW you are lucky I was going through the mail I got from the Nmap mailing list and fond this.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NameServer
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DhcpNameServer
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\*\NameServer
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\*\DhcpNameServer

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet*\Services\Tcpip\Parameters\NameServer
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet*\Services\Tcpip\Parameters\DhcpNameServer
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet*\Services\Tcpip\Parameters\Interfaces\*\NameServer
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet*\Services\Tcpip\Parameters\Interfaces\*\DhcpNameServer
Back to top
View user's profile Send private message
steveiwonder



Joined: 16 Nov 2004
Posts: 83

PostPosted: Sat Feb 04, 2006 5:53 pm    Post subject: Slight Problem Reply with quote

Yeah that works at home but at college is doesnt as i dont have access to command promt or the registry...

So if ya know any other ways then let me know Wink
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sun Feb 05, 2006 3:52 pm    Post subject: Reply with quote

The following function looks promising. Perhaps it can be called with DllCall:

GetAdaptersInfo() at MSDN
Back to top
View user's profile Send private message Send e-mail
AgentSmith15



Joined: 06 May 2005
Posts: 37

PostPosted: Sun Feb 05, 2006 9:16 pm    Post subject: Reply with quote

Well do you have access to "Run. . ." in the start menu? Just type in "cmd" without the quotes and it will open a command prompt.

From there you have 2 options.

The first one is to type in regedit which will open the registry editer.

The second option is to type in "ipconfig /all" without the quotes. That will list the current IP, DHCP server, DNS names, etc.

To capture the information you could use "CMDret.exe" or...

Instead of typing "ipconfig /all" you could type "ipconfig /all >>c:\ipconfig.txt". That would output a text file to the c:\ drive with all the information. Then you could pull it out with AHK.


The file will look like...

Code:

 Windows IP Configuration          Host Name . . . . . . . . . . . . : Desktop         Primary Dns Suffix  . . . . . . . :          Node Type . . . . . . . . . . . . : Hybrid         IP Routing Enabled. . . . . . . . : No         WINS Proxy Enabled. . . . . . . . : No         DNS Suffix Search List. . . . . . : *.rr.com  Ethernet adapter Local Area Connection:          Connection-specific DNS Suffix  . : *.rr.com         Description . . . . . . . . . . . : Intel(R) PRO/100 VE Network Connection         Physical Address. . . . . . . . . : 00-03-**-E9-E7-**         Dhcp Enabled. . . . . . . . . . . : Yes         Autoconfiguration Enabled . . . . : Yes         IP Address. . . . . . . . . . . . : *.*.1.100         Subnet Mask . . . . . . . . . . . : 255.255.255.0         Default Gateway . . . . . . . . . : *.*.1.1         DHCP Server . . . . . . . . . . . : *.*.1.1         DNS Servers . . . . . . . . . . . : ***.**.41.125                                             **.***.40.73                                             ***.**.40.62         Lease Obtained. . . . . . . . . . : Sunday, February 05, 2006 10:27:55 AM         Lease Expires . . . . . . . . . . : Monday, February 06, 2006 10:27:55 AM


I replaced some of the IP's with * so I can remain anonymous.
Back to top
View user's profile Send private message
AgentSmith15



Joined: 06 May 2005
Posts: 37

PostPosted: Sun Feb 05, 2006 9:21 pm    Post subject: Reply with quote

Also if the keyboard has the windows key you could open the run dialog by pressing "Windows Logo+R "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group