Share this question

Welcome to Teachnovice Q&A, where you can ask questions and receive answers from other members of the community.

This is a collaboratively edited question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I have uppercase letters in my domains (similar to Berkeley.EDU)?

0 like 0 dislike

I'm using NSD3, and I'm unsuccessful in trying to have capital letters in my domain names.

How is it possible to have uppercase letters in your DNS?

In various OSS documentation, it's very common to see Berkeley.EDU capitalised, and indeed their DNS is still capitalised to this day:

% traceroute
15  t1-3.inr-201-sut.Berkeley.EDU (  168.794 ms  169.906 ms  168.714 ms
16  t5-5.inr-210-srb.Berkeley.EDU (  168.850 ms  168.912 ms t5-4.inr-210-srb.Berkeley.EDU (  168.886 ms

And in forward DNS, they, too, have various domains capitalised:

% dig
;; AUTHORITY SECTION:        86400   IN      NS        86400   IN      NS        86400   IN      NS        86400   IN      NS        86400   IN      NS        86400   IN      NS
asked Dec 23, 2014 by cnst  
Since DNS records are usually not case-sensitive, why are you trying to do this? Why does it matter?

3 Answers

0 like 0 dislike
Best answer

As noted in (an obscure place in) NSD's documentation,

NSD normalizes names to lower case.

If you want your names to show up with mixed-case, preserving whatever you put in the zone file, you will need to use a different nameserver, such as BIND. It is, after all, the Berkeley Internet Name Daemon...

While it may be possible to hack the NSD source code to make it preserve case, you should be wary of doing this, as it may not be possible to predict what bugs or unintended consequences such a change might introduce, and your nameserver is one of the last places you want mysterious bugs showing up.

answered Dec 23, 2014 by Michael Hampton♦  
Not to mention the delay it adds in smoothly pushing out security updates, particularly if the patches break between revisions. On a less technical note, this is not something I'd want to have to explain to a new manager as my justification for why the company infrastructure is running a set of custom patches.
0 like 0 dislike

They just set that up in their reverse zone. When you traceroute.. it hits the IP then your resolver is asking what the reverse is for the ip.. it would be something like

65     IN      PTR     t1-3.inr-201-sut.Berkeley.EDU.
answered Dec 23, 2014 by Mike  
Per RFC, comparisons of DNS records must be case insensitive. Nothing is said about whether or not the case has to be preserved. It is not considered significant from a data standpoint, and whether or not the case gets discarded is implementation specific.
I think the server return what's in the record. But as for query, it is case-insensitive.
Yes, it's understood that DNS is case insensitive. However, preserving the case is obviously not something that breaks stuff (else, Berkeley.EDU wouldn't be doing so); as such, I'd like to know if there's anything I could do to make my nsd3 to preserve the case of my records (else, some more information about what server/settings they must be using would be useful).
The key phrase here is "implementation specific". Some software will preserve it, others will not. Of the many DNS implementations I have worked with personally, none provide an option for preservation of case that I am aware of. In short, either your DNS server software preserves it or does not, with no option toggle. You are more likely to get faster results by testing various platforms out for yourself than hoping someone else already has. Most DNS administrators consider it insignificant data, and rightfully so.
To put it more simply, this is undefined behavior ( Most administrators don't concern themselves with it because they have no control over what will happen.
0 like 0 dislike

It would appear that your DNS3 server is mangling (normalising) the records for which is it authoritative. Have a look at the source code in particular dname_make and DNAME_NORMALIZE which is just tolower. From

#define DNAME_NORMALIZE        toupper
#define DNAME_NORMALIZE        tolower

It should be fairly easy to pull the SVN repository make a change to dname.h recompile and then get what you want. Of course in doing this your on your own for support.

As Michael Hampton points out this function

const dname_type *
dname_make_from_packet(region_type *region, buffer_type *packet,
               int allow_pointers, int normalize)
    uint8_t buf[MAXDOMAINLEN + 1];
    if(!dname_make_wire_from_packet(buf, packet, allow_pointers))
        return 0;
    return dname_make(region, buf, normalize);

is called with a hard coded parameter or normalize so you'd need to track it down and fix that too.

answered Dec 23, 2014 by Iain  
You'll have to hack a different part of the code if you want to do this. There is a normalize parameter in the dname_make_from_packet function called from packet.c which is hard-coded to 1. But then you get into the question of whether sysadmins should be mucking around in nameserver internals at all...