{
    foreach my $domain (get_domains())
    {

    	$OUT .= "# A Records for Hosts in $domain\n";
        foreach my $h ($hosts->get_hosts_by_domain($domain))
        {
	    my $anIP = undef;
            next unless my $hosttype = $h->prop('HostType');

            if ($hosttype eq 'Self')
            {
                $anIP = $LocalIP;
            }
	    $anIP ||= $h->prop('ExternalIP') || $h->prop('InternalIP');
            $OUT .= "+" . $h->key . ":$anIP\n";
        }
        $OUT .= "\n";
    }
}
