This software uses a hash lookup format to organize DNS MX queries. It streamlines the process of retrieving email exchange servers, optimizing the speed and efficiency of email delivery.
To get started with DNSHash::MX, simply include the required module and tie your hash to DNSHash::MX. Then, you can perform MX lookups by accessing the desired hostname through the tied hash, like this: $mxhostname = $DNS{"host.do.main"}.
One advantage of DNSHash::MX is that it uses the first answer at the lowest priority, similar to how Sendmail would operate. If you define the < preload > file, the hash will be preloaded with the hostname/mxhostname pairs that are found in the file. You can also add assignments to the preload lookup or delete entries from it.
Furthermore, lookups are cached once they've been done if you define < cachedb >. Cache entries are held for a set amount of time - this is based on the TTL of the record, unless < usettl > is undefined. To clear the cache or remove a particular lookup, you can use the delete() function.
One thing to note is that each() on these hashes only walks the preload. However, this shouldn't be a problem for users who only need to perform DNS MX lookups through a tied hash. Overall, I'd highly recommend DNSHash::MX to anyone who needs a quick and efficient way to perform DNS MX lookups in Perl.
Version 0.19: N/A