SEO:适用于 .SE 域的 whois 服务器?
我正在开发一个小型域名检查器,但无法让 .SE 工作:
public string Lookup(string domain, RecordType recordType, SeoToolsSettings.Tld tld)
{
TcpClient tcp = new TcpClient();
tcp.Connect(tld.WhoIsServer, 43);
string strDomain = recordType.ToString() + " " + domain + "\r\n";
byte[] bytDomain = Encoding.ASCII.GetBytes(strDomain.ToCharArray());
Stream s = tcp.GetStream();
s.Write(bytDomain, 0, strDomain.Length);
StreamReader sr = new StreamReader(tcp.GetStream(), Encoding.ASCII);
string strLine = "";
StringBuilder builder = new StringBuilder();
while (null != (strLine = sr.ReadLine()))
{
builder.AppendLine(strLine);
}
tcp.Close();
if (tld.WhoIsDelayMs > 0) System.Threading.Thread.Sleep(tld.WhoIsDelayMs);
return builder.ToString();
}
我尝试过 whois 服务器 whois.nic-se.se 和 whois.iis.se put 我不断收到:
# Copyright (c) 1997- .SE (The Internet Infrastructure Foundation).
# All rights reserved.
# The information obtained through searches, or otherwise, is protected
# by the Swedish Copyright Act (1960:729) and international conventions.
# It is also subject to database protection according to the Swedish
# Copyright Act.
# Any use of this material to target advertising or
# similar activities is forbidden and will be prosecuted.
# If any of the information below is transferred to a third
# party, it must be done in its entirety. This server must
# not be used as a backend for a search engine.
# Result of search for registered domain names under
# the .SE top level domain.
# The data is in the UTF-8 character set and the result is
# printed with eight bits.
"domain google.se" not found.
编辑:
我尝试更改转换为 UTF8,没有其他结果。
当我尝试使用 sysinternals 中的 whois 时,我得到了正确的结果,但不是我的代码,甚至没有使用 SE.whois-servers.net。
/尼尔斯
I'm developing a small domain checker and I can't get .SE to work:
public string Lookup(string domain, RecordType recordType, SeoToolsSettings.Tld tld)
{
TcpClient tcp = new TcpClient();
tcp.Connect(tld.WhoIsServer, 43);
string strDomain = recordType.ToString() + " " + domain + "\r\n";
byte[] bytDomain = Encoding.ASCII.GetBytes(strDomain.ToCharArray());
Stream s = tcp.GetStream();
s.Write(bytDomain, 0, strDomain.Length);
StreamReader sr = new StreamReader(tcp.GetStream(), Encoding.ASCII);
string strLine = "";
StringBuilder builder = new StringBuilder();
while (null != (strLine = sr.ReadLine()))
{
builder.AppendLine(strLine);
}
tcp.Close();
if (tld.WhoIsDelayMs > 0) System.Threading.Thread.Sleep(tld.WhoIsDelayMs);
return builder.ToString();
}
I've tried whois servers whois.nic-se.se and whois.iis.se put I keep getting:
# Copyright (c) 1997- .SE (The Internet Infrastructure Foundation).
# All rights reserved.
# The information obtained through searches, or otherwise, is protected
# by the Swedish Copyright Act (1960:729) and international conventions.
# It is also subject to database protection according to the Swedish
# Copyright Act.
# Any use of this material to target advertising or
# similar activities is forbidden and will be prosecuted.
# If any of the information below is transferred to a third
# party, it must be done in its entirety. This server must
# not be used as a backend for a search engine.
# Result of search for registered domain names under
# the .SE top level domain.
# The data is in the UTF-8 character set and the result is
# printed with eight bits.
"domain google.se" not found.
Edit:
I've tried changing to UTF8 with no other result.
When I try using whois from sysinternals I get the correct result, but not with my code, not even using SE.whois-servers.net.
/Niels
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
嗯,在我的 Mac 上执行
whois google.se
时,我得到以下信息:所以这可能只是您的代码。也许您必须以非 ASCII 编码(例如 UTF8)进行请求?
Hmmm, when doing a
whois google.se
on my Mac I get the following:So it's probably just your code. Maybe you have to do the request in a non-ASCII encoding, such as UTF8?
我终于解决了。
使用wireshark,我看到sysinternals中的whois没有添加“DOMAIN”部分:
string strDomain = recordType.ToString() + " " + domain + "\r\n";
(recordType.ToString ==“域”)。
所以当我删除它时,它起作用了!
I finally solved it.
Using wireshark, I saw that the whois from sysinternals doesn't add the "DOMAIN" part:
string strDomain = recordType.ToString() + " " + domain + "\r\n";
(recordType.ToString == "DOMAIN").
So when I removed that, it worked!
不查看您的代码为什么不:
这将给出你,对于
par.se
如果你只是想要一个IP的RIPE信息,你也可以使用我的页面进行测试
按钮事件
域检查代码:
without looking to your code why not:
this will give you, for
par.se
If you just want the RIPE information of an IP, you can also use my page for test
Button event
DomainCheck code: