According to the docs for AWStats:
AWStats can do reverse DNS lookups through a static DNS cache file that was previously created manually.
Searching through the docs, as well as a fair bit of Googling, leaves me with one question. How do I manually create the DNS cache file? Is there a Linux command to do this that I've yet to find? This is on a Centos 5.5 machine.
As it said underneath, you can use any text editor you want to create a text file with format
ipaddress resolved_hostname
, something like this:Don't forget to set
DNSLookup=2
.Sure, you can do it by getting IP address from the Apache's
access_log
and use some tools such as:dig
,host
,resolveip
, ... to resolve to host name, something like this:To continue updating this file, you can run the above command as a cron job and filter only logs in a specific time range (equal to cron interval).
From the same manual that it says here
So you could generate it by doing something like:
or if you have (as is more likely) IPs
Really though you would want to do something with more error checking and something that works faster than awstats would.