• March 28, 2024, 08:29:33 AM
  • 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 3673 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: 441
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: 49923
  • 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
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.