TLD Delegation Records. How do I get the actual extension?

123 views Asked by At

So I need to validate email addresses to ensure they have a valid TLD. I found http://data.iana.org/TLD/tlds-alpha-by-domain.txt has a list of current TLD's.

I came across records in that list like: "XN--VERMGENSBERATER-CTB" which with some googleing I found is a delegation record for a domain. Here is the iana info: https://www.iana.org/domains/root/db/xn--vermgensberater-ctb.html

My problem is that given the delegation record XN--VERMGENSBERATER-CTB how can I get the actual extension of .VERMÖGENSBERATER programatically?

fwiw I'm using c# but its the method of figuring out how to accomplish the task that I care about.

Thanks,

1

There are 1 answers

1
Calle Dybedahl On BEST ANSWER

No, XN--VERMGENSBERATER-CTB is the IDN-encoded form of VERMÖGENSBERATER. For reasons that we need not go into here, all names in DNS have to be (a subset of) ASCII only. So in order to make it possible to have names with non-ASCII characters in them, like the 'Ö' here, they get encoded into ASCII. You can easily recognize names that have been encoded by the prefix 'XN--'.

You'll have to check the documentation of the programming environment you use to see if it does IDN-encoding of non-ASCII names for you, or if you have to handle that yourself.

Also, please reconsider if you really, really have to do that TLD check at all. It's near-certain that it won't actually accomplish what you want it to.