Re: Resolving IP address to domain name?
- From: Dale <dale@xxxxxxx>
- Date: Mon, 8 Jan 2007 19:42:48 -0500
mayayana said....
Well, then again.........an
Although these both worked, the show stopper is that they both stall for
annoying period of time when there is no reverse DNS for an IP address.
[SNIP}
It's a simple, primitive version of what you
want to do, using gethostbyaddr from ws2_32.dll.
(I think it works on all systems from Win98 up.)
I wrote it for processing my own
server logs. Earthlink hosts my site and a few
years ago they decided to discontinue the courtesy
of resolving the IPs in the server logs. So I wrote
a little utility that I use to occasionally get a better
idea of where people are coming from.
I don't remember, offhand,
whether I added an option to control the timeout
when not getting a response, or whether that's
even possible. But it works fine for me. I process
1-2 MB logs and it takes, typically, about 10
minutes. (Nearly all of that time is waiting for
non-repsonders.)
Thanks for that. I lifted the relevant part and plugged it into my
program. To my dismay I discovered that it was as slow as ever, stalling
with each non-resolving address. But then I found that logging those
addresses and then skipping over them when they reoccur is the key. That
brought the time down to five minutes. I then saved that accumulated list
of bad addresses for reloading the next time the program is run, bringing
the execution time for that test log down to less than 8 seconds. Any new
ones turning up are appended to the list.
I can live with that.
Thanks again.
--
Dale Beckett
.
- Follow-Ups:
- Re: Resolving IP address to domain name?
- From: J French
- Re: Resolving IP address to domain name?
- References:
- Resolving IP address to domain name?
- From: Dale
- Re: Resolving IP address to domain name?
- From: ratz
- Re: Resolving IP address to domain name?
- From: Dale
- Re: Resolving IP address to domain name?
- From: Dale
- Re: Resolving IP address to domain name?
- From: mayayana
- Resolving IP address to domain name?
- Prev by Date: Re: Reset a Cisco 1711 VPN
- Next by Date: Re: run out of space to put controls on form
- Previous by thread: Re: Resolving IP address to domain name?
- Next by thread: Re: Resolving IP address to domain name?
- Index(es):
Relevant Pages
|