[][src]Crate mxdns

DNS utilities for email servers.

Currently, DNS based blocklists and reverse DNS lookups are supported. The crate also supports forward confirmed reverse dns checks.

Examples

use mxdns::MxDns;

let blocklists = vec!["zen.spamhaus.org.","dnsbl-1.uceprotect.net."];
let mxdns = MxDns::new(blocklists).unwrap();

// Check if an IP Address is present on blocklists
let is_blocked = mxdns.is_blocked([127, 0, 0, 2]).unwrap();
assert!(is_blocked);

// Reverse lookup a DNS address
let rdns = mxdns.reverse_dns([193, 25, 101, 5]).unwrap().unwrap();
assert_eq!(rdns, "mail.alienscience.org.");

// Check that the ip resolved from the name obtained by the reverse dns matches the ip
assert!(mxdns.fcrdns([193, 25, 101, 5]).unwrap());

Structs

MxDns

Utilities for looking up IP addresses on blocklists and doing reverse DNS