I'd like to add shorthands for various FQDNs into the /etc/hosts file, such as:pyrrha.compsci.university.org. pyrrhaIs there a way to force the local DNS resolver to process the /etc/hosts entries recursively?Why? Inserting full FQDNs into every config file feels redundant. Creating an alias in a central location solves this and also adds a level of abstraction, which allows for a simple update of the FQDN behind the alias, should it ever change.
Adding recursive entries into `/etc/hosts`
networking;dns;ipv6;hosts
resolv.conf allows you to specify searchdomains. An entry like the following:search cse.iitb.ac.in it.iitb.ac.in iitb.ac.inAllows me to:$ ping -c1 www PING www.cse.iitb.ac.in (10.105.1.3) 56(84) bytes of data.64 bytes from cse.iitb.ac.in (10.105.1.3): icmp_seq=1 ttl=64 time=0.803 ms--- www.cse.iitb.ac.in ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.803/0.803/0.803/0.000 ms$ ping -c1 cygnusPING cygnus.it.iitb.ac.in (10.129.1.1) 56(84) bytes of data.64 bytes from cygnus.it.iitb.ac.in (10.129.1.1): icmp_seq=1 ttl=61 time=0.688 ms--- cygnus.it.iitb.ac.in ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.688/0.688/0.688/0.000 msresolv.conf doesn't apply on entries in /etc/hosts, but if your name is being resolved using a DNS server, then searchdomain might be what you're looking for.