Board index » delphi » Get IP from computer name!

Get IP from computer name!


2006-08-30 05:00:16 PM
delphi148
Hi anybody:
How can i get IP Address from computer name?
Thanks.
 
 

Re:Get IP from computer name!

nslookup computername <ENTER>
;-)
"Akee" <XXXX@XXXXX.COM>writes
Quote

Hi anybody:
How can i get IP Address from computer name?
Thanks.
 

Re:Get IP from computer name!

Quote
How can i get IP Address from computer name?
Using ICS (Download full source code from www.overbyte.be):
1) Synchronous name résolution:
WSocket_Synchronized_ResolveHost('www.borland.com').s_addr
2) Asynchronous name resulution
WSocket.DnsLookup('www.borland.com');
Event OnDnsLookupDone event triggered when resolution is done.
Result of resolution is in DnsResult property.
See DnsLook.dpr demo.
2) Asynchronous name resolution querying a specific DNS server:
Use TDnsQuery component.
See NsLook.dpr demo.
Contribute to the SSL Effort. Visit www.overbyte.be/eng/ssl.html
 

Re:Get IP from computer name!

"Akee" <XXXX@XXXXX.COM>writes
Quote
How can i get IP Address from computer name?
The WinSock gethostbyname() function.
Gambit