Question

This may be a bit of an open ended question, and truth be told I would prefer an exhaustive list, however, this has been bugging me for a while: When is it ok for me to assume a program will use the hostnames specified in /etc/hosts?

Will any of these programs use it?

  • ssh (via ~/.ssh/config) YES
  • dhcp (via /etc/dhcp/dhcpd.conf) YES
  • iptables ?
Was it helpful?

Solution

Every program which needs to map between URL and IP address (gethostbyname and such) will use /etc/hosts and DNS. The order is configurable via nsswitch.conf.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top