␡
- Introduction to Logging in Apache
- Default Apache Log Files
- Creating Log Formats
- Creating a Custom Log File
- Redirecting Logs to an External Program
- Logging Requests Conditionally
- Monitoring Who Is Linking to Your Website
- Monitoring Apache with mod_status
- Monitoring Apache with SNMP
- Analyzing Your Logs with Open-source Tools
- Monitoring Your Logs in Real Time
- Logging Requests to a Database
- Rotating and Archiving Logs
- Controlling IP Address Resolution
- Processing Logged IP Addresses
- Restarting Apache Automatically If It Fails
- Merging and Splitting Log Files
- Keeping Separate Logs for Each Virtual Host
- Common Log Entries
This chapter is from the book
Controlling IP Address Resolution
HostNameLookups on
If you set the HostNameLookups directive to on then Apache will try to determine (resolve) the hostname corresponding to the client's IP-address when it logs the request.
With HostNameLookups set to off, an access_log entry may look like
192.168.200.4 – someuser [12/Jun/2005:08:33:34 +0500] "GET /example.png HTTP/1.0" 200 1234
And with HostNameLookups set to on, the same entry would look like
unit12.example.com - someuser [12/Jun/2005:08:33:34 +0500] "GET /example.png HTTP/1.0" 200 1234
The next section explains the reverse process, how to replace IP addresses in logs with hostnames.