PSla Blog

Blog Piotra Ślatały | Peter Slatala's Blog

Using underscores in DNS hostname in Bind (named)

Underscores are not valid characters in hostnames.

If you have configured your DHCP server to register hostnames in DDNS, following issue may occur: some windows hostnames may contain “_” in their names.
If you do so, following error will be logged by bind:
[cc]
zone zone.name/IN: computer_4.zone.name/A: bad owner name (check-names)
[/cc]

and in logs from isc dhcpd, you will see:
[cc]
Unable to add forward map from computer_4.zone.name to 10.99.0.30: timed out
[/cc]

Although underscores in hostnames are “illegal” (according to RFC 952, and RFC 1123, also RFC about SRV records should be taken into account) they are complying to name restrictions for windows hostname.

Underscores have special use in DNS. Although, if you need to use underscores for your hostnames (i.e. hosts that are using your DHCP might use underscores), you may disable checks in bind.

Simply put to your zone clause in bind following statement:

[cc lang=”whitespace”]
check-names ignore;
[/cc]

You can also use warn instead ignore.

See documentation of BIND zone clause.

 check-names ( fail | warn | ignore );

One response to “Using underscores in DNS hostname in Bind (named)”

  1. […] my knowledge underscores aren't allowed in DNS/Bind, – Restrictions on valid host names – Using underscores in DNS – Valid Names and Labels You can change the way check-names acts: DNS BIND zone clause (look for […]

Leave a Reply

Your email address will not be published. Required fields are marked *