Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have some users entering some email addresses into my system. I want to ensure that their email address is coming from a valid TLD. Based on the list found at [http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains], which TLDs are valid for email addresses? Are they all valid? Or, is it only ones with a certain IDN, DNSSEC, or SLD values?

I'm sorry if this is a dumb question. I'm just trying to understand which TLDs are valid for an email address. Thank you for your help!

share|improve this question
5  
Why bother? If someone's looking to enter invalid data, they'll just do nobody@yourdomain.com if you block TLDs. –  ceejayoz Dec 20 '12 at 21:47
1  
Just for curiousity, what specific problem are you attempting to solve? –  mdpc Dec 20 '12 at 21:48
2  
@ceejayoz I'm a fan of dev@null.net when forced to enter an email address that's checked against whether or not it could be valid. –  HopelessN00b Dec 20 '12 at 21:53
    
@HopelessN00b I feel a little bad for test@test.com for all the stuff I've sent their way. –  ceejayoz Dec 20 '12 at 21:54
1  
no@thanks.com is always a good one. –  fukawi2 Dec 20 '12 at 22:56

2 Answers 2

up vote 4 down vote accepted

A list of the valid TLDs (from ICANN) can be found here. That's about as authoritative as it gets.

# Version 2012122000, Last Updated Thu Dec 20 07:07:02 2012 UTC
AC
AD
AE
AERO
AF
AG
AI
AL
AM
AN
AO
AQ
AR
ARPA
AS
ASIA
AT
AU
AW
AX
AZ
BA
BB
BD
BE
BF
BG
BH
BI
BIZ
BJ
BM
BN
BO
BR
BS
BT
BV
BW
BY
BZ
CA
CAT
CC
CD
CF
CG
CH
CI
CK
CL
CM
CN
CO
COM
COOP
CR
CU
CV
CW
CX
CY
CZ
DE
DJ
DK
DM
DO
DZ
EC
EDU
EE
EG
ER
ES
ET
EU
FI
FJ
FK
FM
FO
FR
GA
GB
GD
GE
GF
GG
GH
GI
GL
GM
GN
GOV
GP
GQ
GR
GS
GT
GU
GW
GY
HK
HM
HN
HR
HT
HU
ID
IE
IL
IM
IN
INFO
INT
IO
IQ
IR
IS
IT
JE
JM
JO
JOBS
JP
KE
KG
KH
KI
KM
KN
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–  mdpc Dec 20 '12 at 21:51
    
1  
And that's only this weeks list. How are you going to handle keeping it updated when all the new TLD's are released (.study .newyork .sydney .nike etc)? –  fukawi2 Dec 20 '12 at 22:57
    
@fukawi2 Not that I think this is a great idea, but it should be pretty trivial to script up a task to automatically download this at whatever interval, and check to see if it's changed. So, he could keep it updated that way. –  HopelessN00b Dec 20 '12 at 23:10
    
@HopelessN00b Of course; but the whole concept is still a Bad Idea (tm) –  fukawi2 Dec 21 '12 at 2:20

The list of valid TLDs is subject to change, so you will need to be able to update the list quickly. It will become very difficult to track once TLDs go up for sale.

Normally in a case like this, I would validate the domain using DNS. You may want to check for an MX record to eliminate domains like www.example.com. While it is valid to only have an A record for a mail domain, most valid e-mail domains will have one or more MX records. Also many TLD registrars return A records on non-existent sub-domains. For valid domains the responses should be very quick. Invalid or missing domains may take a while to return while the resolver times out. Depending on your resolver, results may be faster if you check for example.com. instead of example.com.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.