I would keep it simpler
this is not tested but something like would work
given a file dns-cache.save with format
0.0.0.0 sub.domain.dom
1.0.0.0 sub.domain.dom1
2.0.0.0 sub.domain.dom2
...
dns-cache: parse %dns-cache.save none
foreach ip log [
either none? domain-address: select dns-cache ip
[append dns-cache ip
append dns-cache either none? domain-address: read join dns:// ip
[domain-address: ip]
[domain-address]
]
[domain-address]
use yer domain-address
]
at the end to save I would probably just clobber the old dns-cache file
buffer copy ""
foreach [a b] dns-cache [append buffer rejoin [a "^-" b "^/"]]
write %dns-cache.save buffer
On Thu, 15 Mar 2001 [EMAIL PROTECTED] wrote:
>
> I did try this, but ran into some problems. Here is the code I was using...
>
> DNS-library: load %dns-library.r
> foreach entry DNS-library [
> either find/any entry/2/1 IP-address [
> domain-address: entry/2/2
> ][
> domain-address: read join dns:// IP-address
> new-entry: make block! (rejoin [{DNS ["} IP-address {" "}
> domain-address {"]} ])
> append/only DNS-library new-entry
> save %dns-library.r copy/deep DNS-library
> ]
> ]
>
> Here is (an example of) the contents of the %dns-library.r file
>
> [
> DNS ["0.0.0.0" "sub.domain.dom"]
> ]
>
> The above code would not find IP matches and instead would just keep
> appending the same DNS entries to the library over-and-over.
>
> >make (and save) a hash of ip -> domain-name
> >and only do the dns lookup once per ip
>
> >> Below I am sharing a script that will parse CLF Apache web.log files and
> >> place the data into Excel-friendly .csv files.
> >>
> >> I do have a question, however: the script takes a LONG time to run
> because
> >> of all of the DNS lookups. Is there any way to speed this up?
>
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.