I have a domain myname.com. Normally I access the server using ssh user@myname.com. Some days, I get the message
ssh: connect to host myname.com port 22: Connection refused
Ssh by ip works fine. Leaving it for a few hours/days. The issue is resolved by its own. I also noted that accessing other open ports, for example myname.com:10001, is not possible anymore. Seems that the issue is that ports are not accessible anymore!
I have doubts that this has to do with the hosting provider. Would you share your thoughts on the matter?
EDIT: - I tried nmap to scan for open ports
nmap myname.com
Starting Nmap 7.60 ( https://nmap.org ) at 2020-06-05 13:38 CEST Nmap scan report for myname.com (192.168.x.y) Host is up (0.0058s latency). Other addresses for myname.com (not scanned): xxxx::xxxx:xxxx:xxxx:xxxx rDNS record for 192.168.x.y: myname.com.myname.com Not shown: 992 closed ports PORT STATE SERVICE 22/tcp open ssh ...
The reverse DNS showed that the domain somehow is duplicated 'myname.com.myname.com'.
under /etc/hosts I found the following:
127.0.1.1 myname.com 192.168.x.y myname.com
Which line should I keep ?