SEO A whois server that work for SE domains

0 votes

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

Feb 19, 2022 in Selenium by Kichu
• 19,050 points
894 views

1 answer to this question.

0 votes

I used wireshark, for solving this issue

string strDomain = recordType.ToString() + " " + domain + "\r\n";

(recordType.ToString == "DOMAIN")

see this whoais doesnt add the domain so removing that solved my issue

Hope this helps!

Check out Selenium training and learn from the industry experts!

answered Feb 20, 2022 by narikkadan
• 63,420 points

Related Questions In Selenium

0 votes
1 answer

Is it possible for a website to detect that we are using Selenium with ChromeDriver

Selenium tests for pre-defined javascript variables which ...READ MORE

answered Apr 28, 2018 in Selenium by Meci Matt
• 9,460 points
5,857 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Running a selenium-server-standalone

Below codes will help you: java -jar seleniumjar.jar ...READ MORE

answered Apr 9, 2018 in Selenium by KillerMiller
1,379 views
0 votes
3 answers

Trying to upload files using Selenium(C#)

You can try using Javascript Executor to ...READ MORE

answered Aug 23, 2019 in Selenium by Abha
• 28,140 points
5,216 views
0 votes
1 answer

Deploy my Windows 10 IOT core application locally!

Of course, you, can! That is, in ...READ MORE

answered Jul 17, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
881 views
+6 votes
16 answers

How do backend of these really cool games work?

Most of the games these days don't ...READ MORE

answered Jul 19, 2018 in Career Counselling by Kalgi
• 52,360 points
10,179 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP