Page MenuHomeVyOS Platform

DNS Forwarding should allow _ for srv record
Open, NormalPublicBUG

Description

FQDN validator regex is preventing a valid dns name to be set, specifically, for SRV record

For example

set service dns forwarding authoritative-domain _tcp.db.mongors1.example.com records srv _mongodb entry 0 hostname 'mongors1.example.com'

This will fail.

In vyos-1x/src/validatos/fqdn

The validator doesn't accept underscore _

Details

Difficulty level
Easy (less than an hour)
Version
Current
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

In https://www.rfc-editor.org/rfc/rfc2181#section-11

any binary string whatever can be used as the label of any
   resource record.  Similarly, any binary string can serve as the value
   of any record that includes a domain name as some or all of its value
   (SOA, NS, MX, PTR, CNAME, and any others that may be added).
   Implementations of the DNS protocols must not place any restrictions
   on the labels that can be used.  In particular, DNS servers must not
   refuse to serve a zone because it contains labels that might not be
   acceptable to some DNS client programs.  A DNS server may be
   configurable to issue warnings when loading, or even to refuse to
   load, a primary zone containing labels that might be considered
   questionable, however this should not happen by default.

It seems that there was no limitation on the character that can be used, even binary are acceptable.
But it might be better if we use some form of validation that matches with the real-world use case.

Viacheslav triaged this task as Normal priority.Mar 25 2024, 8:42 AM