For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > August 2004 > net/dns.php and checking validity of e-mail hostnames









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author net/dns.php and checking validity of e-mail hostnames
Scott Harman

2004-08-22, 8:56 am

Hey all -
after checking the minialist documentation, I've found that
read_config() is=20
pretty much mandatory on windows systems... not checked on my linux box
yet.
Would it be feasible to add an option where if a query is called without

first calling read_config it would just use localhost?
I thought I was going mad, assuming that the code fragment would be a
nice=20
little cross platform replacement of getmxrr()

$dns->nameservers() throws an error on my system (Could of course be an
xp=20
issue)

Here's what I'm using instead:

$dnsres =3D new Net_DNS_Resolver();
$dnsres->read_config(INCLUDES_DIR . "resolv.conf");
$resolved =3D $dnsres->("mydomain.com", "CNAME");

if($resolved =3D=3D false)
echo "failed";
else echo "succeeded";

where resolv.conf simply defines localhost at the moment.
without it, will always return false.

Any thoughts you can offer?

Many thanks,

Scott=20
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com