Magento Fix – Email Validation for New gTLDs

Have you come across the following errors in Magento?

  • Invalid email address “[email protected]
  • [email protected]” is not a valid hostname.
  • ‘’ appears to be a DNS hostname but cannot match TLD against known list
  • ‘’ appears to be a local network name but local network names are not allowed

It is probably because the Zend email validation library is not uptodate with all the new gTLDs that are being released.


Navigate to line 539 and comment out the following lines of code. This is where the domain name is checked against an array of validTlds.

if (!in_array($this->_tld, $this->_validTlds)) {
// $this->_error(self::UNKNOWN_TLD);
// $status = false;
// break;

The alternative is to add all possible TLDs into the validTlds array. I prefer the above method as I do not have to keep updating the validTlds array with hundreds of new gTLDs.