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
.
When is it ok to assume /etc/hosts file will be used
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 ?
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow