Hi,
For the purpose of security I would like to restrict access to our web admin
system to
users that are physically in our office.
To this end (& because our internet connection is always a dynamic IP) I have
registered a
dyndns.org domain & have software running to update our IP with the dyndns
servers.
When a user logs in I can now compare their IP to the current IP of our office.
<?php
$officeIP = gethostbyname('example.dyndns.org');
$userIP = $_SERVER['REMOTE_ADDR'];
?>
If they dont match, then I can reject the login. This seemed to work fine for a
short while,
but then after our IP changed it seems that the function gethostbyname() is not
updating ... or is caching in PHP?
I'm not sure which, but if I check my IP on whatismyip.com AND do a Reverse DNS
Lookup
on dnsstuff.com for <example.dyndns.org> - the IP's DO MATCH.
PHP's gethostbyname() however reports the previous IP. If there was a delay in
PHP
updating I could understand, but it is always one step behind - even if i force
our office IP
to change, gethostbyname() quickly updates, but to the old IP - its still one
step behind.
Can anyone help to explain this strange behaviour?
Many Thanks,
Riquez
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/