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?

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.

  • DNS search suffix was the key thing I was missing. – CodeBreaker Jun 15 at 8:49
4

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

Yes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.