D-Link Forums

The Graveyard - Products No Longer Supported => Routers / COVR => DIR-615 => Topic started by: bandwidthinknots on December 22, 2014, 10:44:23 AM

Title: Can't Resolve Host Name Using SSH
Post by: bandwidthinknots 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!




Title: Re: Can't Resolve Host Name Using SSH
Post by: PacketTracer 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 (http://forums.dlink.com/index.php?topic=9283.msg54976#msg54976)" 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 (http://forums.dlink.com/index.php?topic=56993.0) or that one (http://forums.dlink.com/index.php?topic=60349.0). Especially this contribution (http://forums.dlink.com/index.php?topic=60349.msg243086#msg243086) provides a link (http://www.andrewoberstar.com/blog/2012/12/30/raspberry-pi-as-server-dns-and-dhcp) to a solution using a Raspberry-Pi operating as a local DNS server (by using dnsmasq (http://www.thekelleys.org.uk/dnsmasq/doc.html)).

PT
Title: Re: Can't Resolve Host Name Using SSH
Post by: bandwidthinknots 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.

Title: Re: Can't Resolve Host Name Using SSH
Post by: FurryNutz on December 23, 2014, 09:26:33 AM
Thanks PT for providing help and information.  ;)