router2dns - create router interface DNS entries from router configurations
router2dns.pl -V
router2dns.pl -h
router2dns.pl -?
router2dns.pl [-v [level]] [-c filename] [-i] [-o]
Display router2dns.pl version and exit.
Display short help and exit.
Produce verbose output. Level is 1 by default, acceptable values are 0 (silent) to 5 (most verbose).
Use filename as the router2dns configuration file. Default is ./router2dns.conf
Log generated DNS resource records.
Log omitted entities.
router2dns creates DNS entries belonging to router interfaces (or similar network devices). It processes the configuration files of those devices (e.g. Cisco IOS or Juniper JUNOS config files), constructs forward and reverse IPv4 and IPv6 DNS entries, and writes these to stripped down BIND format zone files. The generated zone files contain only A, AAAA, PTR, and CNAME resource records, $ORIGIN specifications, and comments, so these files must either be post-processed (augmented by other necessary items such as SOA, NS, etc., or converted to other formats) or included into zone files containing other resource records.
In the router2dns.conf file the user specifies one or more router configuration files as input, as well as forward and reverse zones as output. Delegated child zones of the reverse zones may also be specified so that reverse entries belonging to those child zones will be omitted. Forward and reverse DNS entries can also be omitted based on the IP address, the interface name, or the VRF the interface belongs to, by specifying an appropriate restriction list.
To use different sets of IP address ranges and/or VRFs please run router2dns with different router2dns configuration files.
For a given interface, router2dns generates forward and reverse DNS resource records according to the following steps:
Both IPv4 and IPv6 addresses of the interface are put on ordered lists. For IOS-type devices, secondary IPv4 addresses are put behind the primary IPv4 address. IPv6 link-local and EUI-64 generated addresses are dropped. IPv6 anycast addresses are put behind IPv6 unicast addresses.
All addresses currently on the lists are considered for PTR records.
(IOS-type devices only) Addresses of interfaces referred to in unnumbered IOS config statements are prepended to the lists if this feature is enabled.
The first addresses (both IPv4 and IPv6) are considered for A and AAAA records, respectively.
The DNS label for the interface is constructed from the interface name found in the device's configuration.
The interface name is converted to lower case.
The beginning of the interface name (the interface type) is replaced according to "interface-type" options.
The interface name is searched for the patterns specified in "interface-substitution" options, and matching patterns are substituted.
Dots, commas, and forward slashes are replaced by dashes.
Currently only Cisco IOS, IOS XE, IOS XR devices are supported by router2dns.
Automatically generated EUI-64 IPv6 addresses are omitted, as they are not in the device's config file.
Process VRRP/HSRP addresses.
Add options for processing multiple addresses on the same interface.
Collecting automatically generated EUI-64 IPv6 addresses via SNMP.
Check for duplicate PTR records for the same IP address.
Delegated forward zones (similarly to reverse zones).
Juniper JUNOS devices.
router2dns.conf(5)