2008-05-03 11:25:22 +00:00
|
|
|
=head1 NAME
|
|
|
|
|
2008-08-02 16:18:07 +00:00
|
|
|
B<makehosts> - sets up /etc/hosts from the xCAT hosts table.
|
2008-05-03 11:25:22 +00:00
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
2010-05-27 08:01:28 +00:00
|
|
|
B<makehosts> [B<-n>] [I<noderange>] [B<-l>|B<--longnamefirst>] [B<-d>] [B<-m>|B<--mactolinklocal>]
|
2008-05-03 11:25:22 +00:00
|
|
|
|
|
|
|
B<makehosts> {B<-h>|B<--help>}
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
|
|
B<makehosts> updates the /etc/hosts file based on entries in the hosts table in the xCAT database.
|
|
|
|
If your node hostnames and IP addresses follow a regular pattern, you can use just a few regular expressions
|
|
|
|
in the hosts table and then easily generate /etc/hosts using makehosts.
|
|
|
|
|
|
|
|
=head1 OPTIONS
|
|
|
|
|
|
|
|
=over 6
|
|
|
|
|
|
|
|
=item B<-n>
|
|
|
|
|
|
|
|
Completely replace the /etc/hosts file, losing any previous content. If this option is not specified,
|
|
|
|
it will only replace the lines in the file that correspond to the nodes in the specified noderange.
|
|
|
|
|
2009-04-02 21:38:45 +00:00
|
|
|
=item B<-l>|B<--longnamefirst>
|
|
|
|
|
|
|
|
The long name of the host will appear before the short name for each host in the /etc/hosts file.
|
|
|
|
The default is short name first.
|
|
|
|
|
2010-05-27 08:01:28 +00:00
|
|
|
=item B<-m>|B<--mactolinklocal>
|
|
|
|
|
|
|
|
Updates /etc/hosts file with IPv6 link local addresses, the link local address is generated
|
|
|
|
from the mac address stored in mac table.
|
|
|
|
|
2010-03-12 22:40:15 +00:00
|
|
|
=item B<-d>
|
|
|
|
|
|
|
|
Delete rather than create records.
|
|
|
|
|
2008-05-03 11:25:22 +00:00
|
|
|
=back
|
|
|
|
|
|
|
|
=head1 EXAMPLES
|
|
|
|
|
|
|
|
=over 2
|
|
|
|
|
|
|
|
=item *
|
|
|
|
|
|
|
|
If the xCAT hosts table contains:
|
|
|
|
|
|
|
|
"compute","|node(\d+)|1.2.3.($1+0)|","|(.*)|($1).cluster.net|",,
|
|
|
|
|
|
|
|
Assuming the group "compute" contains node01, node02, etc., then in /etc/hosts they will be given
|
|
|
|
IP addresses of 1.2.3.1, 1.2.3.2, etc.
|
|
|
|
|
|
|
|
=back
|
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2010-09-29 18:33:32 +00:00
|
|
|
L<hosts(5)|hosts.5>, L<makedns(8)|makedns.8>
|