The REMOTE_HOST
server variable holds the resolved hostname of the remote IP address accessing the site. However, whether this contains the resolved hostname or not is dependent on HostnameLookups On
being set in the server config. It is Off
by default and many hosts disable this feature for performance reasons. This cannot be enabled in .htaccess
.
If the HostnameLookups
is not enabled then REMOTE_HOST
simply contains the same as REMOTE_ADDR
, ie. the IP address of the machine making the request.
Aside:
Be careful of your regex, you seem to be treating *
like a "wildcard" character. In regex *
is a quantifier meaning "0 or more of the preceding item".
^185\.93\.180\.*
This is matching "185.93.180." followed by any number of dots. It should be ^185\.93\.180
or ^185\.93\.180\.
- just remove the *
.
*\.badguys\.com
This is completely invalid. If you want to match any subdomain of "badguys.com" then you need the regex \.badguys\.com$
(basically remove the *
). To match the domain apex or any subdomain then (^|\.)badguys\.com$
.