Reverse dns lookup

Reverse dns lookup

Postby AlexSchaft » Wed Sep 13, 2006 5:43 am

Hi,

The Gethostbyname function resolves a hostname to an ip address. Is there a function available to convert an ip address to a hostname?

Thanks,
Alex
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby James Bott » Wed Sep 13, 2006 5:19 pm

Alex,

Try this:

Code: Select all  Expand view
if WsaStartup()=0
   cServerName := "mail.infovia.com.ar"
   cServerIP   := GetHostByName(cServerName)
   WsaCleanup()
else
  Some kind of error
endif


James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby AlexSchaft » Thu Sep 14, 2006 4:13 am

Hi,

That's the one I know. I'm looking for something that will return cServer from cServerIP. I've been looking at getaddrinfo on MSDN but haven't tackled it yet :)

Alex
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby Enrico Maria Giordano » Thu Sep 14, 2006 7:29 am

AlexSchaft wrote:Hi,

That's the one I know. I'm looking for something that will return cServer from cServerIP. I've been looking at getaddrinfo on MSDN but haven't tackled it yet :)

Alex


Or gethostbyaddr().

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby R.F. » Thu Sep 14, 2006 4:07 pm

Enrico:

Now I just wondering, what this function will return, if several domains are pointing to the same IP Address, for example with the hosting companies, they used to have a single IP and many domains hosted on them. At least is what happen to us ?
Saludos
R.F.
R.F.
 
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Postby Enrico Maria Giordano » Thu Sep 14, 2006 4:44 pm

Sorry, I don't know. I never used that API.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby AlexSchaft » Thu Sep 14, 2006 5:20 pm

RF wrote:Enrico:

Now I just wondering, what this function will return, if several domains are pointing to the same IP Address, for example with the hosting companies, they used to have a single IP and many domains hosted on them. At least is what happen to us ?


www.google.com resolves to 192.220.116.62, which resolves back to e4001.webcom.com

I guess it's the owner of the ip address that decides what gets published for its reverse dns.

Alex
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests