Skip to content

Transformer: BGP Support (MRT)

The BGP Support transformer enriches DNS records with BGP routing metadata extracted from standard MRT (RFC 6396) routing dump files (generated by FRR, BIRD, GoBGP, etc.).

This transformer allows Anycast DNS resolvers and network operators to enrich DNS records with the exact Origin ASN, AS-Path, and BGP Prefix from the local routing view.


Options

  • enable (bool)

    Enable the BGP transformer (default: false)

  • mrt-file (string)

    Path to your BGP MRT routing dump file (.mrt or .mrt.gz)

  • mrt-checkupdate-interval (int)

    How often to check for MRT file updates in seconds (default: 300). If the file modification time or size changes, it is reloaded in the background without downtime.

  • lookup-ecs (bool)

    Lookup EDNS Client Subnet (ECS) IP instead of Query IP if provided in the DNS message (default: false)

  • origin-asn (bool)

    Populate the origin Autonomous System Number (default: true)

  • as-path (bool)

    Populate the full BGP AS-Path (default: true)

  • prefix (bool)

    Populate the longest matching BGP Prefix (default: true)


Configuration

transforms:
  bgp:
    enable: true
    mrt-file: "/var/mrt/full-table.mrt"
    mrt-checkupdate-interval: 300
    lookup-ecs: false
    origin-asn: true
    as-path: true
    prefix: true

Output Fields

When enabled, the following fields are populated in your DNS message:

  • bgp.origin-asn (or bgp-origin-asn in text mode)
  • bgp.as-path (or bgp-as-path in text mode)
  • bgp.prefix (or bgp-prefix in text mode)

JSON Example

{
  "bgp": {
    "origin-asn": "19281",
    "as-path": "174 2914 42 19281",
    "prefix": "149.112.112.0/24"
  }
}