0

I want to be able to convert hostnames to IP addresses in an Apache access log file (i.e. the opposite of what logresolve does).

I have an accesslog file that has been converted with logresolve but I want to revert it.

Each line starts, as an example:

hostname.com - - [01/Jan/2016:00:00:00 +0000] "GET /stuff HTTP/1.1" 200 1046 "http://mywebsite.com" "Mozilla/5.0 (Windows NT 6.1)"

How do I convert hostname.com to an IP address for every line?

ibash
  • 681
  • 3
  • 10
  • 16
  • What have you tried? http://stackoverflow.com/questions/3963085/linux-command-to-translate-domainname-to-ip – tripleee Jan 08 '16 at 10:44
  • Check this http://serverfault.com/questions/618037/how-to-do-a-reverse-dns-lookup-on-my-apache-logs – Siddharth sharma Jan 08 '16 at 10:58
  • I want to do the opposite of logresolve on an accesslog file which has over 10000 lines. Looking up each hostname manually would take a very long time, I want to script it somehow. – ibash Jan 08 '16 at 11:17

0 Answers0