Configuration d’un serveur DNS primaire : (HPUX)

vendredi 17 avril 2009
par  Jerome ROBERT
popularité : 10%

Configuration d’un serveur DNS primaire :

1° aller a la recherche d’information :

Pour les information :

http://rs.ineternic.net

http://www.nic.com/

ou

http://www.nic.fr

pour récupérer de fichier de configuration :

ftp://rs.internic.net/domain/

ou

ftp://ftp.nic.fr/pub/documents/DNS/root.cache/

2° Création d’un fichier /etc/hosts

HP a créé le script hosts_to_named qui permet de
créer les fichiers de configuration DNS en partant de la
configuration existant sur le système. Mais pour cela, il faud
mettre à jour le fichier /etc/hosts.

cat /etc/hosts

127.0.0.1 localhost

192.168.3.120 serveur1.admin-sys.org serveur1

192.168.3.121 serveur2.admin-sys.org serveur2

192.168.3.122 serveur3.admin-sys.org serveur3

128.128.1.100 client1.admin-sys.org client1

128.128.1.101 client2.admin-sys.org client2

128.128.1.102 client3.admin-sys.org client3

3° Préparation

mkdir /etc/named.data

cd /etc/named.data

Pour configurer hosts_to_named, on peut utiliser un fichier qu’on
va appeler param.

Le script hosts_to_named peut utiliser plusieurs options :

<I>-a network-number</I>


 

Add the information about hosts in the local domain from
network network-number. This is the same as the -n

option except that no pointer (PTR) data is created. This is
useful when there are multiple domains on a network and a
different server is handling the address-to-name mapping for
network-number.

-b<I> bootfile</I>

 

Précise le nom et l’emplacement du fichier de
configuration.

Name the boot file bootfile. The default is named.boot

in the current directory.

-c<I> subdomain</I>

 

Create alias (CNAME) records for hosts in subdomain of
the default domain. When a subdomain is delegated, it is useful to
create aliases for the old names in the default domain that point
to the new names in the subdomain. After creating the alias
(CNAME) records, ignore lines in the host table that contain names
in the subdomain. This option can be used more than once on
the command line. This option requires domain names in the host
table. When the old names in this domain are no longer
used, they can be ignored with the -e option. If the
subdomain name does not have dots, the default domain is
appended to subdomain.

-d<I> domain</I>

 

Create data for domain. This option can be used more
than once on the command line if data is being created for more
than 1 domain. The first domain listed is the "default
domain". This option requires domain names in the host table
for all hosts in domains except the default domain.

-e<I> subdomain</I>

 

Eliminate lines from the host table that contain names in the
subdomain before translating. If the subdomain name
does not have dots, the default domain is appended. This option
may be used more than once on the command line. This option
requires domain names in the host table.

-f<I> file</I>

 

Read command line options from file. The -f
option is not allowed within a file.

-h<I> host</I>

 

Declare host to be the host in the start of authority
(SOA) record that the name server data was created on. Also use
host for the electronic mail address of the responsible
user in the SOA record. The default is the host this command is
run on.

-m<I> weight:mailhub</I>


 

For each canonical hostname from the host table, create mail
exchanger (MX) records with the specified weight and mail hub. The
weight is a positive integer. The mail hub is a hostname. If the
mail hub name has no dots, the default domain is appended. This
option can be used more than once on the command line.

-n<I> network-number[:mask]</I>


 

Spécifie les données à créer pour
le numéro de réseau indiqué.

Create data for network-number. See below for
description of network-number. If only one domain is
listed with -d, all data for network-number is
assumed to be in domain. The optional subnet mask mask

can be used instead of supplying each network-number for a
subnet using multiple -n options. mask must be
in dot notation.

-o<I> refresh:retry:expire:min</I>


 

Set the values in the start-of-authority (SOA) record to those
specified. See below for description of the start-of-authority
(SOA) record.

-p<I> domain</I>

 

Create only pointer (PTR) data for hosts in domain. This
is useful when there are multiple domains on a network and a
different server is responsible for domain, but this server
is responsible for the address-to-name mapping. This option can be
used more than once on the command line. This option requires
domain names in the host table.

-q

 

Run quietly. No messages are printed.

-r

 

Indique que le serveur primaire sera également un
serveur root. Cette option entraîne la création de
db.root

Create name server data indicating that the name server is
authoritative for . (the root of the domain tree).
The file created is db.root. Use this only when your
network is isolated from the Internet. If other root servers exist
for the isolated network, they must be added manually.

-s<I> server</I>

 

Create name server (NS) records that declare server is
an authoritative name server for all of the domains created. If
more than 1 server is authoritative, each needs to be declared. If
the server name does not have any dots in it, the default domain
is appended. The default server is the host this script is run on.
This option can be used more than once on the command line.

-t

 

Create text (TXT) records from the comments that appear with
host data. The comments will all be in lower case because the host
table is translated to lower case. If [no smtp]

appears in a comment, it is omitted. The [no smtp] is
used to control mail exchanger (MX) data.

-u<I> user</I>

 

Declare user to be the electronic mail address of the
person responsible for this domain. This is used in the start of
authority (SOA) record. The format required in the name server
data is <I>user</I>.<I>host</I> (host must be a
domain name). If given as user, the host on which this
script is run is appended. If given as user @host,
the @ is replaced with a dot (.). The default user is
root.

-w

 

Create well known services (WKS) data declaring that the host
provides the SMTP service. This is done only when mail exchanger
(MX) data is also being created and only for hosts without

[no
			smtp]

in a comment.

-z<I> internet-address</I>

 

Create a secondary boot file, boot.sec.save, from
the primary boot file listing internet-address as the
server to load the data from. The boot file has the server back up
the data on disk. The internet-address defaults to the
value used with -Z. This option can be used more than
once.

-A

 

Do not create name server data for aliases in the host table.

-C<I> file</I>

 

Create resource records from strings in the comment field of
the host table. Each string in the comment field (except

[no
			smtp]

) is searched for in file. The format of file

is a string, a colon, and a resource record. If the string in the
comment field matches the string before the colon in file,
a resource record is added consisting of the name of the host
followed by everything after the colon from the matching line in
file. For example, host information (HINFO) records can be
created by adding 360:IN HINFO hp9000s360 hp-ux to
file and adding 360 to comments in the host table.

-D

 

Do not create name server data for domain names in the host
table.

-F

 

By default, the serial number is incremented for a domain only
if the data has changed (pointer (PTR) data only). This option
forces the serial number to be incremented, even if the data has
not changed.

-H<I> host-file</I>

 

Use host-file instead of /etc/hosts.

-M

 

Do not create mail exchanger (MX) records for hosts in the host
table.

-N<I> mask</I>

 

Apply the default subnet mask mask to each
network-number specified with -n except for
ones with their subnet masks already provided. mask must be
in dot notation. This is the same as supplying each network-number

for a subnet using multiple -n options.

-S<I> server</I>

 

This option is the same as the -s option, but it
only applies to the last domain specified with -d

or the last network-number specified with -n.
This option is for when server is backing up some, but not
all, of the domains.

-Z<I> internet-address</I>


 

Create a secondary boot file, boot.sec, from the
primary boot file listing internet-address as the server to
load the data from. The boot file does not have the server back up
the data on disk. The internet-address defaults to value
used with -z. This option can be used more than once.

-1

 

This option is obsolete.



vi /etc/named.data/param

-d admin-sys.org

-n 192.168.3

-Z 192.168.3.121

-b /etc/named.boot

Modifier le fichier /etc/rc.config.d/namesvrs

NAMED=1

NAMED_ARGS=""

Modifier ou créer /etc/resolv.conf

domain admin-sys.org

nameserver 192.168.3.120 # serveur primaire

nameserver 192.168.3.121 # serveur secondaire

script hosts_to_named

Ce script permet de générer les fichiers de
configuration du DNS primaire et secondaire si on positionne l’option
z ou Z cf ci-dessus

Attention : il faud executer ce script dans le répertoire de
destination des fichiers donc dans /etc/named.data

cd /etc/named.data

hosts_to_named -f param

Création des fichiers ....

/sbin/init.d/named stop

/sbin/init.d/named start

4° Divers

Les fichiers de données créés

/etc/hosts

 

The host table

named.boot

 

Primary server boot file

boot.cacheonly

 

Caching only server boot file

boot.sec.save

 

Secondary server boot file

boot.sec

 

Secondary server boot file

db.127.0.0

 

Pointer information for 127.0.0.1

db.cache

 

Stub cache file for root server addresses

db.root

 

Data for servers for the root domain

db.DOMAIN

 

Address and other data for a domain

db.DOMAIN.in-addr

 

Pointer data for all network-numbers

db.NET

 

Pointer data for a network-number

Mise à jour du serveur primaire

Mettre à jour le fichier /etc/hosts

Mettre à jour le fichier /etc/named.data/param, si ajout
d’un nouveau réseau

 

cd /etc/named.data

hosts_to_named -f param

 

Pour forcer la mise à jour ou la relecture des fichiers de
configuration du serveur : sig_named restart


Commentaires  Forum fermé

Statistiques

Dernière mise à jour

mercredi 4 octobre 2023

Publication

273 Articles
Aucun album photo
Aucune brève
6 Sites Web
2 Auteurs

Visites

98 aujourd’hui
133 hier
827483 depuis le début
3 visiteurs actuellement connectés