0

This is for personal use, I have a debian running on a VM. I would like to know if BIND9 is required to be able to SSH using the hostname from host machine or modifying the /etc/hosts and resolv.conf will be sufficient?

1 Answer 1

0

No, you do not need BIND or any other DNS service running or available to connect to or from SSH servers so long as you are content to connect using either network addresses, hostnames configured in /etc/hosts, or host aliases in e. g. ~/.ssh/config configuration files.

If there is a DNS service available from another host, having it properly configured in resolv.conf will allow hostname resolution via DNS for SSH clients just as for other network utilities or applications.

3
  • I'm confused. I have configured both /etc/hosts and ~/.ssh/config files on the VM but SSH from the host machine to this VM using the hostname still doesn't work. I had to configure the hosts file on my host machine for it to kind of work but still not what I want to achieve. If I configure the hosts file on the host machine, I still need to use "ssh [email protected]" which is not what I want. My goal is to use only the VM hostname in Putty or use "ssh hostname" to connect to the VM. I have the feeling I'm missing something or looking at the wrong things. Commented Jun 29, 2022 at 8:19
  • If you want to use ssh hostname to connect to a host, there are three options: 1> Add an entry for hostname in /etc/hosts on the client pointing to the network address of that host. 2> Add a Host stanza to your user's .ssh/config file with a HostName directive specifying the network address of the host. 3> If you are relying on DNS resolution and the FQDN of the host is hostname.example.com., add search example.com to /etc/resolv.conf on the client host. Commented Jun 30, 2022 at 14:33
  • I want to HOST --> SSH --> DEBIAN VM. I read that whenever .ssh/config is configured in the guess machine, this ssh configuration is read when I am SSH'ing to the guest VM but it doesn't seem to do that Commented Jul 4, 2022 at 9:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.