DNS record
DNS record(is:|is not:) any of the syntax elements listed below in a semicolon-separated list on the same linetype(is|is not) literal string of one of the following queried record types- Various record-specific properties, operators, and values (see details below)
Purpose
This queries a nameserver and looks for specified DNS records.
Notes
This requirement may be repeated in the same section.
If unstated, the default type is A_AAAA which means the A (IPv4) and AAAA (IPv6) records are queried.
Properties do not have to be listed in a particular order. The type property, for instance, does not have to be listed first.
All segments of a requirement on the same line are logically ANDed together. So, in
# web.illinois.edu should have at least one A record with IP address 18.220.149.166. [DNS:web.illinois.edu] DNS record is: Type is A; IPAddress is 18.220.149.166;
Martinet resolves the web.illinois.edu DNS record. Martinet warns unless an A record with IP address 18.220.149.166 is found.
Properties
Most properties specified in this requirement are specific to a particular DNS record. NameExchange and Preference are for MX records, for example. Filtering DNS records based on non-existant properties for that record type (requiring that the NameExchange property is set a certain way for an A record, for example) will likely result in making Martinet improperly evaluate DNS records.
Type
Unless specified otherwise below, each property (including IPAddress, IP4Address, and IP6Address) takes the following operators and arguments:
isliteral string |is notliteral string
One of the following queried record types:
| DNS record type | DNS record description | Properties and property descriptions |
|---|---|---|
| TXT | Arbitrary data (typically text) |
Properties
Examples[DNS:example.com] # This matches at least one TXT record. DNS record is: Type is TXT; Strings matches bs365-verification=5hun3xp31 |
| SOA | Start of authority record (contains administrative information about the zone) |
Properties
Examples[DNS:example.com] DNS record is: Type is SOA; NameAdministrator is example@example.com |
| PTR | Pointer to a canonical name (typically used for reverse DNS lookups and DNS-SD) |
Properties
Examples[DNS:192.168.1.3] DNS record is: Type is PTR; NameHost is example2.example.com |
| NS | Nameserver (which DNS server is authoritative for that domain; this server should not point to a CNAME record) |
Properties
Examples[DNS:example.com] DNS record is: Type is NS; NameHost is ns1.example.com |
| MX | Mail exchanger (indicates how email messages should be routed in accordance with the Simple Mail Transfer Protocol along with the order, “Preference”, in which the servers should be tried starting with the lowest Preference) |
Properties
Examples[DNS:example.com] # This matches one mail server with preference 10. DNS record is: Type is MX; NameExchange is mail1.example.com; Preference = 10 [DNS:example.com] # This warns if any mail server has a name not like "mailX.example.com" where # X is a positive, non-zero integer. DNS record is: Type is MX; NameExchange matches mail[1-9][0-9]*\.example\.com # These requirements warn if any example.com MX record mail server has # a preference outside the range 10-99 inclusive. DNS record is: Type is MX; Preference < 10 DNS record is: Type is MX; Preference > 99 |
| CNAME | Canonical name (alias) |
Properties
Examples[DNS:www.example.com] # This matches one nameserver. DNS record is: Type is CNAME; NameHost is example.com |
| A_AAAA (default record query type) | IPv4 & IPv6 address |
Properties
NotesSome A and AAAA record queries return multiple IP addresses. If you want to match all of the IP addresses returned, you can do so in one requirement with anis or matches condition, or you can use separate matches requirements each matching one or more IPs.
Examples[DNS:example.com] # This matches multiple IP addresses in one requirement. DNS record is: Type is A_AAAA; IPAddress matches ^192\.168\.1\.3|192\.168\.1\.4|2607:f8b0:4009:801::200e|2207:feb0:4a09:801::2b0e$ [DNS:example.com] # This matches multiple IP addresses in multiple requirements. DNS record is: Type is A_AAAA; IP4Address is 192.168.1.3 DNS record is: Type is A_AAAA; IP6Address is 2607:f8b0:4009:801::200e DNS record is: Type is A_AAAA; IPAddress matches ^192\.168\.1\.4|2407:f8b0:4019:801::100b|2207:feb0:4a09:801::2b0e$ |
| AAAA | IPv6 address |
Properties
NotesSome AAAA record queries return multiple IP addresses. If you want to match all of the IP addresses returned, you can do so in one requirement with anis or matches condition, or you can use separate matches requirements each matching one or more IPs.
Examples[DNS:www.example.com] # This matches multiple IP addresses in one requirement. DNS record is: Type is AAAA; IPAddress matches ^2607:f8b0:4009:801::200e|2407:f8b0:4019:801::100b|2207:feb0:4a09:801::2b0e$ [DNS:example.com] # This matches multiple IP addresses in multiple requirements. DNS record is: Type is AAAA; IPAddress is 2607:f8b0:4009:801::200e DNS record is: Type is AAAA; IPAddress matches ^2407:f8b0:4019:801::100b|2207:feb0:4a09:801::2b0e$ |
| A | IPv4 address |
Properties
NotesSome A record queries return multiple IP addresses. If you want to match all of the IP addresses returned, you can do so in one requirement with anis or matches condition, or you can use separate matches requirements each matching one or more IPs.
Examples[DNS:www.example.com] # This matches multiple IP addresses in one requirement. DNS record is: Type is A; IPAddress matches ^192\.168\.1\.3|192\.168\.1\.4|192\.168\.1\.6|192\.168\.1\.23$ [DNS:example.com] # This matches multiple IP addresses in multiple requirements. DNS record is: Type is A; IPAddress is 192.168.1.3 DNS record is: Type is A; IPAddress matches ^192\.168\.1\.4|192\.168\.1\.6|192\.168\.1\.23$ |
Example output
Line 6: 2 DNS records do not match the criteria:| Name | Type | TTL | IPAddress |
|---|---|---|---|
| illinois.edu | AAAA | 25 | 2620:0:e00:4206::14 |
| illinois.edu | A | 175 | 130.126.157.20 |
Example configuration
# web.illinois.edu should not have at least one A record with IP address 18.220.149.166. [DNS:web.illinois.edu] DNS record is not: Type is A; IPAddress is 18.220.149.166;
Example output
Line 6: 1 DNS record does not match the criteria:| Name | Type | TTL | IPAddress |
|---|---|---|---|
| web.illinois.edu | A | 195 | 18.220.149.166 |
Example configuration
# Warn when incoming-relays.illinois.edu lacks an IPv6 AAAA record. [DNS:incoming-relays.illinois.edu] DNS record is: Type is AAAA;
