SSH | Network is unreachable

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mandersonrmark

SSH | Network is unreachable

Post by mandersonrmark »

Hello Everyone..
I have several servers-- each with a unique hostname on a LAN. I am unable to ssh via hostname-- only using it's IP address.
When I add the IPs and hostnames to my hosts file it works, but I have many servers... My old distribution did not require manually assigning them... I was able to login directly using the remote servers hostname.

Code: Select all

manderson@mander-nux ~ $ ssh root@b01-c
ssh: Could not resolve hostname b01-c: Name or service not known

When I do it by IP Address it is correct-- see below.

Code: Select all

manderson@mander-nux ~ $ ssh root@192.168.1.10
Linux B01-C 4.1.9 #1 SMP PREEMPT Tue Nov 22 18:27:45 PST 2016 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Aug 17 10:49:28 2018 from 192.168.1.251
root@B01-C:~# 
I have created an ssh rsa public profile on my server
I recently switched to Mint from another distribution and did not have this issue.

Code: Select all

####################MINT INFO##############################
RELEASE=18.3
CODENAME=sylvia
EDITION="KDE 64-bit"
DESCRIPTION="Linux Mint 18.3 Sylvia"
DESKTOP=KDE
TOOLKIT=QT
NEW_FEATURES_URL=http://www.linuxmint.com/rel_sylvia_kde_whatsnew.php
RELEASE_NOTES_URL=http://www.linuxmint.com/rel_sylvia_kde.php
USER_GUIDE_URL=`yelp help:linuxmint`
GRUB_TITLE=Linux Mint 18.3 KDE 64-bit
cd /

Code: Select all

#######################RESOLVE.CONF#######################
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1

Code: Select all

####################NSLOOKUP####################
manderson@mander-nux /etc $ nslookup b01-c
Server:         127.0.1.1
Address:        127.0.1.1#53

** server can't find b01-c: NXDOMAIN

I was hoping not to have to add all of them to the /etc/host file--- but I think this might be the only solution.
Thank you !!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rene
Level 20
Level 20
Posts: 12240
Joined: Sun Mar 27, 2016 6:58 pm

Re: SSH | Network is unreachable

Post by rene »

If b01-c is running mDNS (on Linux, in the form of Avahi) you'll be able to address it as b01-c.local. Or B01-C.local as per your SSH login display, but I do believe mDNS is case insensitive.

I suppose the difference with your previous distribution may be B01-C having Samba running and the previous distribution on "mander-nux" having WINS enabled by default; that you were using Windows name resolution.
Locked

Return to “Networking”