0

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 ?

2
  • So where is the server you are trying to connect to? If it is somewhere on the internet, then both of those host file entries are wrong. Secondly can you run 'hostname' and 'domainname' in terminal and share the results. I wonder if your hostname and domain name are both set to myname.com.
    – Wayno
    Jun 6, 2020 at 10:46
  • hostname was myname.com; domainname retruned (none).
    – mtleis
    Jun 6, 2020 at 12:29

1 Answer 1

0

The first problem sounds like a DNS issue. If it works sometimes and not others by DNS name but always works by IP, I'd say there is an issue with your DNS zone. Probably mis-matched name servers.

The second problem is hard to answer without more information. Do you have SSH configured to accept connections on random ports? Is there any kind of firewall in front of it? Do you have a dedicated host or is it part of some shared web hosting plan?

1
  • I tried to scan open ports on the domain. The report showed that rDns is myname.com.myname.com.
    – mtleis
    Jun 5, 2020 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.