NS2ALIASES
Section: Maintenance Commands (8)
Updated: April 4, 1992
Index
Return to Main Contents
NAME
ns2tab - Extract a sendmail aliases table from the nameserver
SYNOPSIS
ns2tab
[
option ...
]
DESCRIPTION
Ns2tab
is a program to query Internet domain name servers and print the
information retrieved in different formats. Supported formats include
aliases(5) for sendmail, /etc/group, /etc/passwd, /etc/hosts and
aliases.text for the Elm mailer.
ARGUMENTS
If given no arguments, ns2tab will query the domain found in
/etc/resolv.conf and print on stdout an aliases-table.
Behaviour can be modified by the style=XX argument, where XX is
one of:
- aliases
-
Output is in /usr/lib/aliases format, which also is compatiple
with an mh-alias file. Information is gathered from MB, MR, MINFO, MG
and UINFO resource records. Maillists with no members are ignored.
- elm
-
This is a slightly different way of representing the same information
for elm.
This style will only be used if you don't intend to have have an
/usr/lib/aliases or equivalent.
- lelm
-
Known as local elm, because it make elm expect that the recipients will
be expanded into real adresslists by the mail agent. In short, if you use
this, then you must also generate an /usr/lib/aliases file (if you use
sendmail).
- group
-
Outputs maillists in group format.
If any members are groups (They have a MINFO record) they will be expanded
unless there is a UID. This will be done recursively. Beware that this
opens an alley to loop referencing.
Information is gathered from MINFO, MG, GID and UINFO resource records.
- nrgroup
-
Nonrecursive group format.
- pwupd
-
Runs through the passwd table using getpwent(3), looks up each name
in the nameserver, and outputs the account-line with the GECOS field
replaced with the value of the UINFO resource record.
- hosts
-
As you would expect: /usr/hosts. To avoid excessive long lines host-aliases
are not domain-expanded.
Information is gathered from A, CNAME and HINFO records.
The next set of styles are only relevant if you have linked in Hesiod
emulation. The intent is to allow you to use Hesiod, even though not all
of your computers support it. The query class does not have to HS, but
can be anything supported by your nameserver. This way you can get
Hesiod functionality even if none of your computers support it.
Note that ns2tab defaults to query the IN class.
- fstab
-
Ns2tab
will prepend filsys to your current domain, look for TXT records
and print in /etc/fstab style as in Ultrix 4.x and BSD4.2.
- checklist
-
Same, but output is in /etc/checklist format as used on HP/UX and others:
- filesys
-
SCO Unix V.3.2 /etc/default/filesys format.
- vfstab
-
UNIX V.4 /etc/vfstab format.
- passwd
-
Ns2tab
prepends passwd and outputs password file entries.
- printcap
-
Output is in /etc/printcap format.
server=server
will set the server to query. If not used ns2tab will default
to a value found in /etc/resolv.conf
Remember to query an autoritative server, otherwise you get no output.
out=filename
Opens a file where all output will go.
domain=domain
The domain to query. If specified more than once ns2tab will
load the additional domains into the same internal tables, overwriting
if there is any redundant data. This feature allow you to have special
versions of the same file for a single or a cluster of computers.
Consider: ns2tab domain=dc.dk load domain=cluster1.dc.dk style=group
class={IN,CHAOS,HS,ANY}
Sets the query class. Ns2tab assume IN semantics for all
ressource records no matter what class you use.
suffix=domain
Use this argument if the domain to query is subjugated a higher level
domain. (meaning: it doesn't have its own SOA).
load
Explicitly load the resource records.
Ns2tab
will do it automatically if when it is time to print.
print
Print in the style previously set.
It will allow you to print several styles in the same run.
EXAMPLES
Given the following nameserver records, the format for each style is
shown below.
-
bob MR robert
rnews MR "|/usr/local/bin/uurec"
robert MB hostx
UINFO "Robert Robespierre,MH-2323,3998"
wheel MINFO wagner root
GID 0
UINFO "Root task force"
MG robert
MG james
dyer.filsys IN TXT "NFS /mit/dyer eurydice w /mit/dyer"
Aliases format:
bob: robert
rnews: "|/usr/local/bin/uurec"
# robert +- Robert Robespierre,MH-2323,3998
robert: robert@hostx
# Root task force
wheel-request: wagner
owner-wheel: root
wheel: robert,james
elm format:
bob = = robert
rnews = = "|/usr/local/bin/uurec"
robert = Robert Robespierre,MH-2323,3998 = robert@hostx
wheel-request = wheel Request = wagner
owner-wheel = wheel Errors = root
wheel = Root task force = robert, james
group format:
wheel:*:0:robert,james
fstab format:
/mit/dyer@eurydice:/mit/dyer:rw:0:0:nfs:hard,intr:
- and if robert has a passwd entry like:
robert:Idh.wiU8oiJww:3028:1:Robert Robespierre,MH-4572,3652:/u/robert:
it will become:
robert:Idh.wiU8oiJww:3028:1:Robert Robespierre,MH-2323,3998:/u/robert:
Try: ns2tab server=dc.dk dom=dc.dk out=/tmp/aliases style=aliases
out=/tmp/elm style=elm
DIAGNOSTICS
If the lookup request was not successful, an error message is printed.
Possible errors are:
- Timed out
-
The server did not respond to a request after a certain amount of
time (changed with timeout=value)
and a certain number of retries (changed with retry=value).
- No response from server
-
No name server is running on the server machine.
- No records
-
The server does not have resource records of the current query type for the
host, although the host name is valid.
The query type is specified with the querytype command.
- Non-existent domain
-
The host or domain name does not exist.
- Connection refused
-
- Network is unreachable
-
The connection to the name server could not be made
at the current time.
- Server failure
-
The name server found an internal inconsistency in its database
and could not return a valid answer.
- Refused
-
The name server refused to service the request.
- Format error
-
The name server found that the request packet was not in the proper format.
It may indicate an error in ns2tab.
FILES
/etc/resolv.conf initial domain name and
name server addresses.
ENVIRONMENT
LOCALDOMAIN overrides default domain.
BUGS
I'm sure I left some in.. but I've forgotten where..
SEE ALSO
resolver(3), resolver(5), named(8), nslookup(8),
RFC-1034 ``Domain Names - Concepts and Facilities''
RFC-1035 ``Domain Names - Implementation and Specification''
``The Hesiod Name Server'' by Stephen P. Dryer
AUTHOR
Soren Roug, based on the nslookup program developed by
Andrew Cherenson
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- ARGUMENTS
-
- EXAMPLES
-
- DIAGNOSTICS
-
- FILES
-
- ENVIRONMENT
-
- BUGS
-
- SEE ALSO
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 06:26:06 GMT, December 12, 2024