Underscore sign in dns name field #3037

Closed
opened 2025-12-29 18:25:00 +01:00 by adam · 2 comments
Owner

Originally created by @szutman on GitHub (Dec 3, 2019).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.6

Steps to Reproduce

  1. IPAM -> Add new IP Address
  2. In DNS Name field use underscore (-)

When I want to use underscore in dns name there is warning that only alphanumeric chracters, hyphens, and periods are allowed in DNS names

Expected Behavior

Is there any chances to allow underscore in DNS Name field ?

As we can read in wikipedia article about dns names

"While a hostname may not contain other characters, such as the underscore character (_), other DNS names may contain the underscore.[5][6] This restriction was lifted by RFC 2181, Section 11. Systems such as DomainKeys and service records use the underscore as a means to assure that their special character is not confused with hostnames. For example, _http._sctp.www.example.com specifies a service pointer for an SCTP-capable webserver host (www) in the domain example.com."
https://en.wikipedia.org/wiki/Hostname

Then I think that underscoure could be valid sign of dns name, am I right ?

PS. I can live with that because I figured it out how to allow underscore sign in my installation of Netbox (ipam -> validators.py) but I'am affraid of future upgrade Netbox, because after done migrations there is a small change in db scheme - is this something that I have to worry about that ?

PS2. I love Netbox at first sight ;)

Cheers,
Szutman

Originally created by @szutman on GitHub (Dec 3, 2019). ### Environment * Python version: 3.6.8 * NetBox version: 2.6.6 ### Steps to Reproduce 1. IPAM -> Add new IP Address 2. In DNS Name field use underscore (-) When I want to use underscore in dns name there is warning that only alphanumeric chracters, hyphens, and periods are allowed in DNS names ### Expected Behavior Is there any chances to allow underscore in DNS Name field ? As we can read in wikipedia article about dns names "While a hostname may not contain other characters, such as the underscore character (_), other DNS names may contain the underscore.[5][6] This restriction was lifted by RFC 2181, Section 11. Systems such as DomainKeys and service records use the underscore as a means to assure that their special character is not confused with hostnames. For example, _http._sctp.www.example.com specifies a service pointer for an SCTP-capable webserver host (www) in the domain example.com." https://en.wikipedia.org/wiki/Hostname Then I think that underscoure could be valid sign of dns name, am I right ? PS. I can live with that because I figured it out how to allow underscore sign in my installation of Netbox (ipam -> validators.py) but I'am affraid of future upgrade Netbox, because after done migrations there is a small change in db scheme - is this something that I have to worry about that ? PS2. I love Netbox at first sight ;) Cheers, Szutman
adam added the status: acceptedtype: feature labels 2025-12-29 18:25:00 +01:00
adam closed this issue 2025-12-29 18:25:00 +01:00
Author
Owner

@DanSheps commented on GitHub (Dec 4, 2019):

If we are going strictly by hostnames, then underscore would not be allowed, however since the DNS name is tied to an IP, I don't think strictly going by the hostname specification is required.

@DanSheps commented on GitHub (Dec 4, 2019): If we are going strictly by hostnames, then underscore would not be allowed, however since the DNS name is tied to an IP, I don't think strictly going by the hostname specification is required.
Author
Owner

@kobayashi commented on GitHub (Dec 5, 2019):

I agree with Dan's comment.

@szutman can you volunteer to take on this if you are interested? DNS validation is implemented here.

@kobayashi commented on GitHub (Dec 5, 2019): I agree with Dan's comment. @szutman can you volunteer to take on this if you are interested? DNS validation is implemented [here](https://github.com/netbox-community/netbox/blob/develop/netbox/ipam/validators.py).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3037