esmith::HostsDB - interface to esmith hostnames/addresses database

In a root terminal you can do the command below if you want to display the up-to-date content

perldoc -U esmith::HostsDB
         use esmith::HostsDB;
         my $hosts = esmith::HostsDB->open;

         # everything else works just like esmith::DB::db

         # these methods are added
         my @hosts     = $hosts->hosts;
         my @new_hosts = $hosts->propogate_hosts;

This module provides an abstracted interface to the esmith hosts database. Unless otherwise noted, esmith::HostsDB acts like esmith::DB::db.

Overridden methods

open

Like esmith::DB→open, but if given no $file it will try to open the file in the ESMITHHOSTSDB environment variable or hosts.

open_ro()

Like esmith::DB→openro, but if given no $file it will try to open the file in the ESMITHHOSTS_DB environment variable or hosts.

These methods are added be esmith::HostsDB

hosts

                 my @hosts = $hosts->hosts;

Returns a list of all host records in the database.

propogate_hosts

                 my @new_hosts = $hosts->propogate_hosts($old_name, $new_name);

When the name of your e-smith machine changes, this will change the name of any hosts which also started with $oldname to use the $newname.

Returns a list of the newly tranlsated host records.

                $db->get_hosts_by_domain

Given a domain name (as a string), finds any hosts which match it and return them as a list of record objects.

     SME Server Developers <bugs@e-smith.com>