Skip to content
Snippets Groups Projects
Thomas Bellman's avatar
Thomas Bellman authored
This adds a new flag 'default_self' to the parse_host_mac_ip_list()
function.  When given, the IP address list will default to consist
of the hostname if neither any addresses nor an explicity "-" are
listed.  In combination with the 'resolve' flag, the hostname will
be resolved into numeric IP addresses; else it will behave as if the
hostname was surrounded by square brackets, and thus added to the
'ip_Name' element in the result.

This is useful when the IP addresses are provided outside of the
hostlist, e.g. in DNS, NIS or LDAP.  Users can then provide lists
of just the hostnames and the MAC addresses, have the hostnames
resolved into IP addresses, and generate e.g. DHCP config files
with numeric addresses in them.

Another potential use case, could be to generate /etc/hosts files
that effectively act as caches for DNS, allowing a node to do
hostname lookups of the most common names or addresses even if the
catalogue service is unavailable.
a3d95ec7
History
Name Last commit Last update