note 111684 added to function.gethostbyname

From: Date: Sat, 16 Mar 2013 08:34:31 +0000
Subject: note 111684 added to function.gethostbyname
Groups: php.notes 
Request: Send a blank email to php-notes+get-194093@lists.php.net to get a copy of this message
If you do a gethostbyname() and there is no trailing dot after a domainname that does not resolve, this domainname will ultimately be appended to the server-FQDN by nslookup. So if you do a lookup for nonexistentdomainname.be your server may return the ip for nonexistentdomainname.be.yourhostname.com, which is the server-ip. To avoid this behaviour, just add a trailing dot to the domainname; i.e. gethostbyname('nonexistentdomainname.be.') ---- Server IP: 64.71.164.2 Probable Submitter: 80.101.213.12 ---- Manual Page -- http://php.net/manual/en/function.gethostbyname.php Edit -- https://master.php.net/note/edit/111684 Del: integrated -- https://master.php.net/note/delete/111684/integrated Del: useless -- https://master.php.net/note/delete/111684/useless Del: bad code -- https://master.php.net/note/delete/111684/bad+code Del: spam -- https://master.php.net/note/delete/111684/spam Del: non-english -- https://master.php.net/note/delete/111684/non-english Del: in docs -- https://master.php.net/note/delete/111684/in+docs Del: other reasons-- https://master.php.net/note/delete/111684 Reject -- https://master.php.net/note/reject/111684 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#194093) next »