【问题标题】:Is there a way to detect fake domain name of email address? Using Perl, php, javascript?有没有办法检测电子邮件地址的假域名?使用 Perl、php、javascript?
【发布时间】:2013-12-23 16:49:33
【问题描述】:

如果有人知道我们如何检测电子邮件地址的假域名,那将是一个很大的帮助。

请注意,我不想验证电子邮件。我想知道电子​​邮件域名是否存在。

【问题讨论】:

  • 那么像 NSLOOKUP 这样的东西是不可能的吗?或php.net/gethostbyaddr
  • 域名可以存在,但邮箱地址本身不存在。。只查域名有什么用?
  • @AliTrixx,你是对的,但至少如果我能检测到域名是否是假的,我可以避免很多垃圾邮件用户。

标签: javascript php perl email


【解决方案1】:

在php中有一个函数checkdnsrr

How do you check if a domain name exists?

if (checkdnsrr('test.nl', 'A')) // or use ANY or for other see above link
{
    echo 'Domain exists';
}
else 
{ 
    echo 'Domain does not exist'; 
} 

----------------- 正在运行的代码------

 <?php 

if (checkdnsrr('google.com', 'A')) // or use ANY or for other see above link
{
    echo 'Domain exists';
}
else 
{ 
    echo 'Domain does not exist'; 
}

?>
//Output = Domain exists

//

if (checkdnsrr('fakewebtesting.com', 'A')) // or use ANY or for other see above link
{
    echo 'Domain exists';
}
else 
{ 
    echo 'Domain does not exist'; 
}

?>
  //Output = Domain does not exists

我希望您从电子邮件中提取域名并在此功能中使用它。

文档链接:

http://php.net/manual/en/function.checkdnsrr.php

【讨论】:

  • 无论我尝试什么,它都表示域存在。它似乎对我没有帮助。
  • 我试过了,它给了我准确的信息。你能发布一些你正在使用的代码吗
  • 我试过你的样品。它给了我这个:域存在域存在
  • 在这里再次为我工作。你能把你的代码贴在这里我可以测试一下。
  • 您使用的是哪个版本的 PHP?在 Windows 或 Linux 上,因为更改日志显示:5.3.0 此功能现在可在 Windows 平台上使用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-10-21
  • 2021-09-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-16
  • 1970-01-01
相关资源
最近更新 更多