Re: Quering given dns and list A records with PHP

From: Date: Tue, 03 Jul 2001 15:14:37 +0000
Subject: Re: Quering given dns and list A records with PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-55992@lists.php.net to get a copy of this message
By design, most DNS servers won't let you do this because it's something of a security risk. However, for DNS servers that *will* let you do it, there isn't a built-in function in PHP that will do what you want, but I imagine you can accomplish it by interacting with a unix shell and using the nslookup command. I don't know the code to do this, but am sure there are tons of examples around. Once you get access to the shell, the commands you want are as follows: shellprompt> nslookup shellprompt> ls -t any domainname.com where domainname.com is the domain you're looking for. Again, note that 9 times out of 10, you're going to get a "Query Refused" result since most DNS servers won't give you this information. You can get an idea of your success rate by simply trying the above commands in your own *nix shell for various domain names. Most/all of the big guys (yahoo, sun, etc.) are blocked. hth --kurt ----- Original Message ----- From: "Mohamedou" <php_salahi@yahoo.fr> To: <php-general@lists.php.net> Sent: Tuesday, July 03, 2001 3:41 AM Subject: [PHP] Quering given dns and list A records with PHP Hello all, Can somebody help me I need to query a given DNS Server identified by IP and the domain I want query and then it gives me the whole machines it has registered Regards Moh

« previous php.general (#55992) next »