User Tools

Site Tools


dns_record

This documentation describes something in development This documentation describes either documentation for something in development or a planned requirement which is not yet ready for production use. Expect changes.

DNS record

  • DNS record (is: | is not:) any of the syntax elements listed below in a semicolon-separated list on the same line
    • type (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:

  • is literal string | is not literal string

One of the following queried record types:

DNS record type DNS record description Properties and property descriptions
TXT Arbitrary data (typically text)

Properties

  • TTL (< | = | != | >) non-negative integer — Time to live — how long (in seconds) the queried nameserver will cache this record.
  • Strings — The textual data.

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

  • TTL (< | = | != | >) non-negative integer — Time to live — how long (in seconds) the queried nameserver will cache this record.
  • PrimaryServer — The fully-qualified domain name of the primary nameserver.
  • NameAdministrator — Email address of the domain administrator. The DNS record value will change the at sign (@) to a dot (.). Martinet will allow you to specify the value as a typically-formatted email address.
  • SerialNumber — The record's serial number.

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

  • TTL (< | = | != | >) non-negative integer — Time to live — how long (in seconds) the queried nameserver will cache this record.
  • NameHost — The fully-qualified domain name of the canonical name.

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

  • TTL (< | = | != | >) non-negative integer — Time to live — how long (in seconds) the queried nameserver will cache this record.
  • NameHost — The fully-qualified domain name of the nameserver.

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

  • TTL (< | = | != | >) non-negative integer — Time to live — how long (in seconds) the queried nameserver will cache this record.
  • NameExchange — The fully-qualified domain name of a mail server.
  • Preference — Used to determine the order in which mail servers for this domain are tried. When connecting to a mail server, MX record NameExchange FQDNs are tried in lowest to highest order by Preference value.

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

  • TTL (< | = | != | >) non-negative integer — Time to live — how long (in seconds) the queried nameserver will cache this record.
  • NameHost — The fully-qualified domain name of the target.

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

  • TTL (< | = | != | >) non-negative integer — Time to live — how long (in seconds) the queried nameserver will cache this record.
  • IPAddress — Both A (IPv4) and AAAA (IPv6) address records are queried and both IPv4 and IPv6 results are available. This is the default record type queried if no type is specified.
  • IP4Address — AAAA (IPv6) address records are queried.
  • IP6Address — A (IPv4) address records are queried.

Notes

Some 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 an is 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

  • TTL (< | = | != | >) non-negative integer — Time to live — how long (in seconds) the queried nameserver will cache this record.
  • IPAddress — The IPv6 address or addresses listed with this record.
  • IP6Address — AAAA (IPv6) address records are queried.

Notes

Some 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 an is 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

  • TTL (< | = | != | >) non-negative integer — Time to live — how long (in seconds) the queried nameserver will cache this record.
  • IPAddress — The IPv4 address or addresses listed with this record.
  • IP4Address — A (IPv4) address records are queried.

Notes

Some 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 an is 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

  1. # web.illinois.edu should not have at least one A record with IP address 18.220.149.166.
  2. [DNS:web.illinois.edu]
  3. 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

  1. # Warn when incoming-relays.illinois.edu lacks an IPv6 AAAA record.
  2. [DNS:incoming-relays.illinois.edu]
  3. DNS record is: Type is AAAA;

Example output

Line 6: No incoming-relays.illinois.edu DNS AAAA record matches “Type is AAAA;”.

dns_record.txt · Last modified: by ghqkt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki