I know this is an old question, but it came up high on google when searching for TLD lists so I figured I would post an updated answer.
Like @BillThor, I'm also a fan of using DNS check (eg is there an MX record for name
email.split('@') when validating email.
The goal isn't to force user to enter a real email address...in that case you would usually send a verification email. Rather you are trying to help the user in case there is a typo/etc....do as much verification as possible to make the user's life easier. Any user that doesn't want to give out their real email has many free services available to avoid this.
For general domain validation (as opposed to email validation) when checking TLDs it is important to remember that some TLDs have different rules. This is where the iana list isn't ideal. For instance domain.co.uk is a valid domain. domain.uk is not.
uk is on the iana list,
co.uk is not.
The best source I have found for validating TLDs is here: https://publicsuffix.org/ You can quite easily script a daily/weekly/monthly update and then run your code against the list.
For more context you can also see this outdated mozilla wiki page: https://wiki.mozilla.org/TLD_List
Of course, just validating the TLD doesn't mean that the domain is valid or registered or the correct input...but the original question is about determining if a domain has a valid TLD.