gpt4 book ai didi

c# - SEO : A whois server that work for . SE 域?

转载 作者:行者123 更新时间:2023-11-30 22:42:26 26 4
gpt4 key购买 nike

我正在开发一个小型域名检查器,但我无法让 .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 我不断得到:

# 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。

/尼尔斯

最佳答案

嗯,在我的 Mac 上执行 whois google.se 时,我得到以下信息:

# 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.

state: active
domain: google.se
holder: googoo5855-00001
admin-c: -
tech-c: -
billing-c: -
created: 2008-10-20
modified: 2010-09-18
expires: 2011-10-20
transferred: 2009-03-06
nserver: ns1.google.com
nserver: ns2.google.com
nserver: ns3.google.com
nserver: ns4.google.com
dnssec: unsigned delegation
status: ok
registrar: MarkMonitor Inc

所以这可能只是您的代码。也许您必须以非 ASCII 编码(例如 UTF8)执行请求?

关于c# - SEO : A whois server that work for . SE 域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4423328/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com