Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 May 1998 10:55:21 -0700
From:      Studded <Studded@san.rr.com>
To:        leifn@internet.dk
Cc:        questions@FreeBSD.ORG
Subject:   Re: perl, MX lookup
Message-ID:  <35719989.A1F48A75@san.rr.com>
References:  <Pine.BSF.3.96.980528235405.8435A-100000@darla.swimsuit.internet.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
Leif Neland wrote:
> 
> In a perlscript, I can use gethostbyname to check if a given host exists.
> 
> But how can I check if there exists a MX-record for a given host?
> I probably could system("host -t MX $host"), but I'd rather have a
> "native" perl solution.
> 
> (I want to check in a script if an email-adress contains a valid hostpart)

	Keep in mind that the abscence of an MX record doesn't make a hostname
an invalid delivery address. The default (which is quite servicable in
most cases) is to attempt delivery to the A address. That said, I
believe that one of the perl modules in the ports collection will help
you with what you want, probably the DNS module. 

Good luck,

Doug

-- 
***         Chief Operations Officer, DALnet IRC network        ***
***   Proud designer and maintainer of one of the world's largest
*** Internet Relay Chat servers with 5,328 simultaneous connections
***   Try spider.dal.net on ports 6662-4    (Powered by FreeBSD)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35719989.A1F48A75>