0

Something very strange happened to my server.

From home (where my server is also) I used to ssh using my server name. From outside I ssh using my domain name, which obviously points to my home server. However since today, I cant ssh into my server using my server name from home.

I cant think why that is, I havent done any changes. Any body knows what could cause this issue?

I am using mobaxterm to ssh if that helps. I also use pub/priv ssh key.

Update:

I am trying to ssh using my server name, very rarely it works, but most of the time it says "host does not exist"

Thanks

  • Have you tried using just the IP address? If it works with the IP, then it's your name resolution that is not working anymore. If it doesn't work with the IP, then there is something up with your server setup. – G Trawo Apr 28 '19 at 1:16
  • @G Trawo its working now, I have no idea whats happening, I think might be the router that is not recognising both device is local or maybe the router is just being too slow and its timing out before it bounces back any information – LukeDS Apr 28 '19 at 1:32
  • I would look at what @Comar suggested, with a possible IP conflict. Is it a static assigned address? An IP conflict can cause intermittent issues like that. – G Trawo Apr 28 '19 at 1:36
  • Does your /etc/nsswitch.conf have a line like: hosts: files mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname If not, add the libnss-resolve package to add the resolve section. – ubfan1 Apr 28 '19 at 3:20
  • @ubfan1 Considering that he is using mobaxterm, which is a Windows program, I would assume that he won’t have nsswitch.conf. And it works sometimes. These intermittent problems can difficult to diagnose. – G Trawo Apr 28 '19 at 11:47
1

Looks like it's DNS related issue or a network problem.

Make sure that your domain name resolves properly into your server's IP.

host domain

or

nslookup domain

When it comes to network issues use mtr for packet losses or other network problems:

mtr domain

This might be also caused by fail2ban, if you have it installed on your server of course.

In rare cases, there might be IP addresses conflict, meaning that another device in your LAN or WAN binds to your server's IP.

Use dmesg to find out if your NIC is f.e. reseting

sudo dmesg | grep NIC

Also make sure that your server's IP is static. Most of ISP's provides you with dynamic IP. In that case you should consider a DDNS service.

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.