Felhasználói eszközök

Eszközök a webhelyen


oktatas:linux:dns_szerver:root_es_tld_beallitasa

< DNS szerver

Root és TLD beállítása

Bevezetés

Szeretnénk saját root és TLD, és normál DNS szervert beállítani. Ezt tesztelni fogjuk egy webszerverrel, egy parancssoros „otthoni” géppel és egy ISP DNS szerverrel, ami a feloldást végzi.

A DNS szerverekre a bind9,dnsutils és az mc csomagok szükségesek. Az otthoni tesztgépre a dnsutils és w3m csomagok szükségesek. A webszerverre az mc és a apache2.

Környezet

Az „and” felső szintű tartománynevet (TLD) fogjuk használni.

gép neve tartománynév IP Megjegyzés
gep1 ns.root 10.0.0.1 gyökér DNS
gep2 a.and 10.0.0.2 TLD szerver
gep3 zold.and 10.0.0.3 DNS szerver
gep3 ns.zold.and 10.0.0.3 DNS szerver alias
gep4 piros.and 10.0.0.4 Webszerver
gep5 isp.and 10.0.0.5 Az ISP DNS szervere
gep6 otthon.and 10.0.0.10 Otthoni gép

Root szerver (gep1)

Állítsuk be a gyökérszervert.

mkdir /etc/bind/zone
cd /etc/bind
cp named.conf named.conf.origin
mcedit /etc/bind/named.conf
/etc/bind/named.conf
options {
    directory "/etc/bind/zones";    
}
 
zone "." {
    type master;
    file "root.zone";
    allow-transfer { none; };
};
 
 
  mcedit zones/root.zone
 
<code dns zones/root.zone>
$ORIGIN .
$TTL 2d
.         SOA  ns.root. hostmaster.ns.root. (
          3h 15m 1w 2d )
.         NS   ns.root.
ns.root.  A    10.0.0.1
 
$ORIGIN and.
@         NS   a.and.
a.and     A    10.0.0.2

TLD szerver (gep2)

A TLD szerver mondja meg, hogy ki a felelős a piros.and és a zold.and tartománynévért.

mkdir /etc/bind/zones
mcedit /etc/bind/named.conf
/etc/bind/named.conf
options {
    directory "/etc/bind/zones";
};
 
zone "and" {
    type master;
    file "and.zone";
    allow-transfer { none; };
};
mcedit zones/and.zone
zone/and.zone
$ORIGIN and.
$TTL 2d
@             SOA  a.and. hostmaster.a.and. (
              2017010600 3h 15m 1w 2d )
and.          NS   a.and.
a.and.        A    10.0.0.2
 
$ORIGIN piros.and.
@             NS   ns.zold.and.
ns.zold.and.  A    10.0.0.3
 
$ORIGIN zold.and.
@             NS   ns
ns            A    10.0.0.3

DNS szerver (gep3)

mkdir /etc/bind/zones
cd /etc/bind
mcedit name.conf
named.conf
options {
    directory "/etc/bind/zones";
};
 
zone "piros.and" {
    type master;
    file "piros.and.zone";
    allow-transfer { none; };
};
 
zone "zold.and" {
    type master;
    file "zold.and.zone";
    allow-transfer { none; };
};
mcedit /etc/bind/zones/piros.and.zone
/etc/bind/zones/piros.and.zone
$TTL 3d
@                 SOA    ns.zold.and. hostmaster.zold.and. (
                  2017010600 3h 15m 1w 2d )
piros.and.        NS     ns.zold.and.
piros.and.        A      10.0.0.4
/etc/bind/zones/zold.and.zone
$TTL 2d
@                 SOA    ns.zold.and. hostmaster.zold.and. (
                  2017010600 3h 15m 1w 2d )
zold.and.        NS     ns.zold.and.
zold.and.        A      10.0.0.3
ns.zold.an.      A      10.0.0.3
www              CNAME  zold.and.

ISP DNS szervere

Az Internetszolgáltató DNS szervere.

cd /etc/bind/
mcedit named.conf
/etc/bind/named.conf
options {
    directory "/etc/bind/zones";
};
 
zone "." {
    type hint;
    file "root.zone";
};
mcedit zones/root.zone
zones/root.zone
.            3600     NS     ns.root.
ns.root      3600     A      10.0.0.1

Ha az otthon.and gépen beállítjuk DNS szervernek az isp.and névszervert előfordulhat, hogy nem az érvényes adatokat látjuk, mert az ISP DNS szervere cache-ben tárolja az adatokat, és mi azt látjuk. Teszteléskor a DNS cache-t üríthetjük így:

rndc flush

"Otthoni" gépen

DNS szolgáltató beállítása:

echo "nameserver 10.0.0.5" > /etc/resolv.conf

Teszt:

dig @10.0.0.5 piros.and.
host piros.and.

Irodalom

Forrás

Ajánlott

oktatas/linux/dns_szerver/root_es_tld_beallitasa.txt · Utolsó módosítás: 2023/08/20 23:16 szerkesztette: admin