dns
Namespace: global/dns
Functions used to query the DNS.
fn
resolver
fn resolver(params: ?) -> Result<DnsResolver>
- Description
- Args
- Example
Build a DNS resolver.
TODO
TODO
fn
lookup
fn lookup(dns: DnsResolver, host: String) -> Array>
- Description
- Args
- Return
- Effective smtp stage
- Errors
- Examples
Performs a dual-stack DNS lookup for the given hostname.
host
- A valid hostname to search.
array
- an array of IPs. The array is empty if no IPs were found for the host.
All of them.
- Root resolver was not found.
- Lookup failed.
#{
preq: [
action "lookup recipients" || {
let domain = "gmail.com";
let ips = dns::lookup(domain);
print(`ips found for ${domain}`);
for ip in ips { print(`- ${ip}`); }
},
],
}
fn
rlookup
fn rlookup(dns: DnsResolver, ip: String) -> Array>
- Description
- Args
- Return
- Effective smtp stage
- Errors
- Examples
Performs a reverse lookup for the given IP.
ip
- The IP to query.
array
- an array of FQDNs. The array is empty if nothing was found.
All of them.
- Failed to convert the
ip
parameter from a string into an IP. - Reverse lookup failed.
#{
connect: [
rule "rlookup" || {
state::accept(`250 client ip: ${"127.0.0.1"} - ${dns::rlookup("127.0.0.1")}`);
}
],
}