=head1 NAME

domain - nnrpd domain resolver

=head1 SYNOPSIS

B<domain> I<domain-name>

=head1 DESCRIPTION

This program can be used in F<readers.conf> to grant access based on the
subdomain part of the remote hostname.  In particular, it only returns
success if the remote hostname ends in I<domain-name>.  (A leading dot on
I<domain-name> is optional; even without it, the argument must match on
dot-separated boundaries).  The C<username> returned is whatever initial
part of the remote hostname remains after I<domain-name> is removed.  It
is an error if there is no initial part (that is, if the remote hostname
is I<exactly> the specified I<domain-name>).

=head1 EXAMPLE

The following readers.conf(5) fragment grants access to hosts with
internal domain names:

    auth internal {
        res: "domain .internal"
        default-domain: "example.com"
    }

    access internal {
        users: "*@example.com"
        newsgroups: example.*
    }

Access is granted to the example.* groups for all connections from hosts
that resolve to hostnames ending in C<.internal>; a connection from
C<foo.internal> would match access groups as C<foo@example.com> identity.

=head1 BUGS

It seems the code does not confirm that the matching part is actually at
the end of the remote hostname (e.g., C<domain: example.com> would match
the remote host C<foo.example.com.org> by ignoring the trailing C<.org>
part).

Does this resolver actually provide any useful functionality not
available by using wildcards in the readers.conf(5) I<hosts> parameter?
If so, the example above should reflect this functionality.

=head1 HISTORY

This documentation was written by Jeffrey S<M. Vinocur> <jeff@litech.org>.

=head1 SEE ALSO

nnrpd(8), readers.conf(5)

=cut
