[SOLVED] Can't ssh to foo on LAN, but foo.example.com works

Forum rules
Before you post please read how to get help

[SOLVED] Can't ssh to foo on LAN, but foo.example.com works

Postby uberamd on Mon Dec 10, 2012 10:35 am

I use Linux Mint in a VM on my work computer and for quite some time now I've been using Linux Mint MATE with little issue. I installed a new VM with Linux Mint KDE and while 99.9999% of things are working perfectly awesome there is one thing that isn't working. This is happening while on network: example.com

Problem:
Code: Select all
$ ssh foo
ssh: Could not resolve hostname foo: Name or service not known


However this works perfectly fine:
Code: Select all
$ ssh foo.example.com


Expected Behavior:
Typing ssh foo while on the example.com network, system should know that foo resides on the same network and shouldn't require me to type in the example.com. My MATE install knows I'm on the same network and can properly resolve foo to foo.example.com, ex: ping foo will ping foo.example.com.

I've done lots of searching yet haven't found anything. Also asked on both #linuxmint-help and #kde with no success/replies.
Last edited by uberamd on Wed Dec 12, 2012 3:17 pm, edited 1 time in total.
uberamd
Level 1
Level 1
 
Posts: 2
Joined: Mon Dec 10, 2012 10:07 am

Linux Mint is funded by ads and donations.
 

Re: Can't ssh to foo on LAN, need to type ssh foo.example.co

Postby uberamd on Wed Dec 12, 2012 3:17 pm

Answered my own question here after some digging.

Turns out you need to create the /etc/resolv.conf file and tell it to search your domain.

Code: Select all
# vim /etc/resolv.conf

---- In the empty resolv.conf file add:
search example.com

---- Restart networking
# /etc/init.d/networking restart
uberamd
Level 1
Level 1
 
Posts: 2
Joined: Mon Dec 10, 2012 10:07 am

Re: [SOLVED] Can't ssh to foo on LAN, but foo.example.com wo

Postby wavespot on Fri Dec 14, 2012 5:12 am

Your workaround works, but it's hard coded and now, you can't enjoy dynamic configuration made by NetworkManager.

First, you're right, /etc/resolv.conf must exists : but it's a link to /run/resolvconf/resolv.conf. You can re-create it with :

sudo ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf

Then, add your local domain using NetWorkManager in the 'Search Domain' tab.

Just for your information, try ssh foo.local, if this particular machine is a linux (or Mac, don't konw about windows) with multicast DNS activated, it works. No need to add your local domain then.
wavespot
Level 2
Level 2
 
Posts: 92
Joined: Tue Jan 17, 2012 6:44 am


Return to KDE

Who is online

Users browsing this forum: No registered users and 4 guests