0

The company I work at has a lot of local server accessible via hostname (ABCSRVDC01 for example). To connect to one of them over SSH I don't need to use the ip address of the server, but instead use the hostname. Me knowing what hostnames are, goes to check the hosts file for a list of all available servers, but to my surprise, it was empty. Which left me baffled. I was used to putting hostnames in the hosts file to have an easy to remember alias for a specific ip. But it was empty.

So how does my computer know how to resolve ABCSRVDC01 to an actual ip address?

I wish to use this kind of setup in my homelab. I have a PowerDNS installed on one of my servers and use .local pseudo-TLD to access my local services (nexcloud.local, heimdall.local etc.). Now I wish to access the underling server using a hostname.

I cant figure out how are they doing this. They use a local DNS? Some router configuration? Does PowerDNS support resolving hostnames not only FQDN?

CodeBreaker
  • 159
  • 4

2 Answers2

3

I cant figure out how are they doing this. They use a local DNS?

Yes.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171
2

A hostname is a domain name, when combined with a DNS search suffix from your local resolver. On linux this is usually in the /etc/resolv.conf file, or possibly /etc/resolv.conf.d/ directory.

Ryan Fisher
  • 2,218
  • 16
  • 13