note 119969 added to function.checkdnsrr

From: Date: Fri, 30 Sep 2016 10:02:18 +0000
Subject: note 119969 added to function.checkdnsrr
Groups: php.notes 
Request: Send a blank email to php-notes+get-206709@lists.php.net to get a copy of this message
Important Warning: You need to add a dot to the end of the host name to make a fully qualified domain name. To see why, try executing the following pieces of code: $d1="gmail.con"; $d2="gmail.con."; $r1=checkdnsrr($d1, "MX"); $r2=checkdnsrr($d2, "MX"); var_dump($r1); var_dump($r2); You will see that without the dot it claims that the domain "gmail.con" is valid. Note that if you time the "checkdnsrr()" calls you will also see it takes longer without the dot because it treats it as a relative domain and does several tries based on the host name it is running on. NB: in case you're interested, being treated as a relative domain explains what is happening. If your host is "example.com" the relative domain will eventually resolve to "gmail.con.com." which can be looked up, hence it wrongly claims "gmail.con" exists ---- Server IP: 72.52.91.14 Probable Submitter: 88.149.143.191 ---- Manual Page -- http://php.net/manual/en/function.checkdnsrr.php Edit -- https://master.php.net/note/edit/119969 Del: integrated -- https://master.php.net/note/delete/119969/integrated Del: useless -- https://master.php.net/note/delete/119969/useless Del: bad code -- https://master.php.net/note/delete/119969/bad+code Del: spam -- https://master.php.net/note/delete/119969/spam Del: non-english -- https://master.php.net/note/delete/119969/non-english Del: in docs -- https://master.php.net/note/delete/119969/in+docs Del: other reasons-- https://master.php.net/note/delete/119969 Reject -- https://master.php.net/note/reject/119969 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#206709) next »