Monday, 15 July 2013

Whois apnic issue -



Whois apnic issue -

using next code whois lookups :

public static string lookup(string ip, string whoisserver){ string buff = string.empty; string strdomain = ip + "\r\n"; byte[] arrdomain = encoding.ascii.getbytes(strdomain); using (tcpclient tcp = new tcpclient(whoisserver, 43)) { using (stream tcpstream = tcp.getstream) { using (streamreader objsr = new streamreader(tcpstream, encoding.ascii)) { tcpstream.write(arrdomain, 0, strdomain.length); buff = objsr.readtoend; } } } homecoming buff; }

works fine (ripe, arin, lacnic, afrinic) except whois.apnic.net. using wireshark noticed apnic keeps sending identical responses @ increasing intervals.

does know why ?

additionally, why ip address assigned apnic (103.31.186.82) point romania 'isp' located in republic of latvia ?

where feeding in \r\n sequence:

string strdomain = ip + "\r\n";

try feeding in \n:

string strdomain = ip + "\n";

or \r:

string strdomain = ip + "\r";

some of whois servers respond line end and/or carriage homecoming on own rather usual paired one, , depend on os running on server generally.

it's much same when processing text files across different platforms, windows machines tend utilize double line ending, linux/unix variants... vary :-)

additionally

there many reasons, it's isp's headquarters / head offices located in republic of latvia , address in record used query tool used give geographical info hq one, while physical ip link in geographical area you'd expect.

whois

No comments:

Post a Comment