PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Vanessa Vasile's Blog: Using PHP to Perform DNS Lookups

Note: This article was originally published at PHPDeveloper on 2 July 2010.
PHPDeveloper

In a handy little post to her blog today Vanessa Vasile has an example of how to use built-in PHP functions to perform DNS lookups in your scripts.

PHP has a couple DNS functions you can use to perform record lookups. Most of us are familiar with the two basic ones - gethostbyname() and gethostbyaddr(), both of which perform a single function '" returning a hostname or IP address.

She also mentions the gethostbynamel and dns_get_record functions that can give you even more insight into the current DNS of a given domain (even returning only record-type specific information).