{
    use esmith::ConfigDB;
    my $confdb = esmith::ConfigDB->open_ro;
    my $systemname = $confdb->get_value('SystemName');
    my $domainname = $confdb->get_value('DomainName');
    my $fqdn = $systemname . '.' . $domainname;
    die "Cannot determine FQDN of server!" unless $fqdn;

    # Make sure that the ReverseDNS property of the proper name of the server
    # is set to "yes", unless the $LocalIP has a configured PTR record already.
    my $self_host = undef;
    my $work_to_do = 1;
    foreach my $host ($DB->get_all())
    {
        next unless $host->prop('HostType') eq 'Self';
        if ($host->{key} eq $fqdn)
        {
            $self_host = $host;
        }
        if ($host->prop('ReverseDNS') && ($host->prop('ReverseDNS') eq 'yes'))
        {
            # It already has one configured. Nothing to do.
            $work_to_do = 0;
            last;
        }
    }
    if ($work_to_do)
    {
        die "Failed to find host record for server's proper name!"
            unless $self_host;
        $self_host->set_prop('ReverseDNS', 'yes');
    }
}
