Im very new to network programming and faced a following problem:
Im working on VMware CentOS7 virtual machine on Windows10 host. My script should send WHOIS queries and parse their output (e.g. expiration date).
However, an attempt to send a query leads to a connection error:
>>>import whois
>>>whois.query('google.com')
WhoisCommandFailed: connect: Network is unreachable
I tried to whois
from terminal, but error was the same.
When i tried to use whois
directly from Windows, which hosts virtual machine, the error seemed to look same as well (connection timeout).
As i found out, it was most likely related to access to port 43. I created rules (for in and out) for Windows firewall for this port by a guide , but error still persisted.
It looks like access to this port was blocked by ISP (however ping
command is working).
To sum up, I got two questions there:
1) (less important) How to check if port 43 is blocked by firewall either by ISP?
2) (most important) Is it possible somehow to reconfigure WHOIS for usage of another port (i.e. 23) for sending queries by Python script?
Unfortunately, ISP security policy doesn't allow them to open 43 port.
Mostly ISP doesn't block any port but yes, this is not 100% true.
Testing connection:
tcpdump
(install command: yum install tcpdump
) command on CentOS: tcpdump -peni any tcp and port 43
192.168.1.1.57350 > 192.34.234.30.43
where 192.34.234.30 IP address means the remote whois server.telnet 192.34.234.30 43
Trying 192.34.234.30...
Connected to 192.34.234.30.
Escape character is '^]'.
You cannot change port number, because it is configured on the remote side, on the server.
Can CentOS7 server communicate towards the internet? In example can you install packages?
Is there any router between windows machine and ISP?