From a97ebc6d4cf4aecbb35f4de7e5ebe5b6410f09bf Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 5 Dec 2019 21:14:29 -0500 Subject: [PATCH] Fixes #3722: Allow the underscore character in IPAddress DNS names --- docs/release-notes/version-2.6.md | 1 + netbox/ipam/validators.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-2.6.md b/docs/release-notes/version-2.6.md index 3eee2df6f..cf03ea8f2 100644 --- a/docs/release-notes/version-2.6.md +++ b/docs/release-notes/version-2.6.md @@ -6,6 +6,7 @@ * [#3457](https://github.com/netbox-community/netbox/issues/3457) - Display cable colors on device view * [#3329](https://github.com/netbox-community/netbox/issues/3329) - Remove obsolete P3P policy header * [#3663](https://github.com/netbox-community/netbox/issues/3663) - Add query filters for `created` and `last_updated` fields +* [#3722](https://github.com/netbox-community/netbox/issues/3722) - Allow the underscore character in IPAddress DNS names ## Bug Fixes diff --git a/netbox/ipam/validators.py b/netbox/ipam/validators.py index 6669b7ec5..4659a9177 100644 --- a/netbox/ipam/validators.py +++ b/netbox/ipam/validators.py @@ -2,7 +2,7 @@ from django.core.validators import RegexValidator DNSValidator = RegexValidator( - regex='^[0-9A-Za-z.-]+$', - message='Only alphanumeric characters, hyphens, and periods are allowed in DNS names', + regex='^[0-9A-Za-z.-_]+$', + message='Only alphanumeric characters, hyphens, periods, and underscores are allowed in DNS names', code='invalid' )