• July 12, 2020, 01:29:13 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: Can't Resolve Host Name Using SSH  (Read 2645 times)

bandwidthinknots

  • Level 1 Member
  • *
  • Posts: 2
Can't Resolve Host Name Using SSH
« on: December 22, 2014, 10:44:23 AM »

Router information:
Model: DIR-615
Hardware Version: E3     
Firmware Version: 5.13

Hello Sage Ones,

I am attempting to secure shell between two linux machines on a local network. I am able to ssh between the machines using their local IP addresses, but I am not able to ssh using the machine's host names. So for example:

Target host name: mytargethost
Target IP: 192.168.0.111 (static)
Username: myusername

This works: ssh myusername@192.168.0.111
This fails: ssh myusername@mytargethost
With error: "ssh: Could not resolve hostname mytargethost: Name or service not known"

For now, being able to ssh via IP is fine, but I am curious about why the host name fails. My guess is that there is a simple setting in the router's configuration that would solve this. I haven't been able to find a solution in the 615's GUI, however. I have tried to ssh with the "Enable DNS Relay" box checked and unchecked, to no avail. Any ideas?

Thanks!




Logged

PacketTracer

  • Level 4 Member
  • ****
  • Posts: 435
Re: Can't Resolve Host Name Using SSH
« Reply #1 on: December 22, 2014, 04:40:07 PM »

Hi,

your DIR-615 is not designed for resolving host names of local machines to their IP addresses. At most it just deploys (a) DNS server address(es) to clients via DHCP, that they use to resolve EXTERNAL names (always "fully qualified domain names (FQDN)" of the form "host.domain-suffix"). These addresses identify either external DNS servers (which your DIR-615 learns e.g. dynamically from your ISP during Internet connection setup) or it is the address of your DIR-615 itself, when "DNS Relay" is enabled, where your DIR-615 takes all DNS requests for Internet name resolution and relays them to the external DNS servers.

Resolution of local names must be provided by local solutions of your own, for example by operating a local DNS server or by using HOST files.

See similar threads, for example this one or that one. Especially this contribution provides a link to a solution using a Raspberry-Pi operating as a local DNS server (by using dnsmasq).

PT
« Last Edit: December 22, 2014, 05:31:32 PM by PacketTracer »
Logged

bandwidthinknots

  • Level 1 Member
  • *
  • Posts: 2
Re: Can't Resolve Host Name Using SSH
« Reply #2 on: December 22, 2014, 07:15:29 PM »

Thanks PacketTracer,

That satisfies my curiosity. I do, in fact, have my /etc/hosts file set up to direct my browser accordingly but now I won't have to obsess over this little secure shell detail. I really like the -615, it's a great little router.

Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 48960
  • D-Link Global Forum Moderator
    • Router Troubleshooting
Re: Can't Resolve Host Name Using SSH
« Reply #3 on: December 23, 2014, 09:26:33 AM »

Thanks PT for providing help and information.  ;)
Logged
"Nothing Funny about It...." We are not here to Impress anyone! You have a be a COMPETENT user first to under stand COMPETENT help!