PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Bind löst nur FQHN auf, nicht Hostname



pixel
07.04.16, 18:44
Hallo zusammen,

ich habe auf einem der Nameserver ein Problem welches ich nicht lokalisiert bekomme. HostOS ist Ubuntu 14.04.4 LTS. Hier die entsprechende Konfigurationen:

/etc/hosts

127.0.0.1 localhost
127.0.1.1 kvm01
192.168.5.1 kvm01.dental.lan kvm01
kvm01 ist also der Nameserver.

/etc/network/interfaces

# Loopback-Interface
auto lo
iface lo inet loopback

# Schnittstelle für intern
auto eth0
iface eth0 inet manual

auto intern
iface intern inet static
address 192.168.5.1
network 192.168.5.0
netmask 255.255.255.0
gateway 192.168.5.5
dns-nameservers 192.168.5.1
dns-search dental.lan
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

# Schnittselle für extern
auto eth1
iface eth1 inet manual

# Bridge für das externe WAN
auto extern
iface extern inet manual
bridge_ports eth1
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

/etc/bind/named.conf

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

/etc/bind/named.conf.local

include "/etc/bind/ddns.key";

zone "dental.lan" {
type master;
file "/var/cache/bind/db.dental.lan";
allow-update { key "DHCP_UPDATER"; };
};

zone "5.168.192.in-addr.arpa" IN {
type master;
file "/var/cache/bind/db.5.168.192";
allow-update { key "DHCP_UPDATER"; };
};

/etc/bind/named.conf.local

include "/etc/bind/ddns.key";

zone "dental.lan" {
type master;
file "/var/cache/bind/db.dental.lan";
allow-update { key "DHCP_UPDATER"; };
};

zone "5.168.192.in-addr.arpa" IN {
type master;
file "/var/cache/bind/db.5.168.192";
allow-update { key "DHCP_UPDATER"; };
};

/etc/bind/named.conf.default-zones

// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
type master;
file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};

/etc/bind/db.dental.lan

$TTL 172800 ; 2 days
@ IN SOA kvm01.dental.lan. root.dental.lan. (
2016040701 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
2419200 ; expire (4 weeks)
10800 ; minimum (3 hours)
)
@ IN NS kvm01.dental.lan.
IN MX 10 kolab.dental.lan.
IN A 192.168.5.1

kvm01 IN A 192.168.5.1
ipfire IN A 192.168.5.5
tux IN A 192.168.5.6
kolab IN A 192.168.5.7

/etc/bind/db.5.168.192

$TTL 172800 ; 2 days
@ IN SOA kvm01.dental.lan. root.dental.lan. (
2016040701 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
2419200 ; expire (4 weeks)
172800 ; minimum (2 days)
)
@ IN NS kvm01.dental.lan.
1 IN PTR kvm01.dental.lan.
5 IN PTR ipfire.dental.lan.
6 IN PTR tux.dental.lan.
7 IN PTR kolab.dental.lan.


Ein Linux-Host hat die IP (statisch) 192.168.5.7 und den FQHN "kolab.dental.lan" Mache ich nun direkt am Nameserver einen:

root@kvm01:~# ping kolab
ping: unknown host kolab

klappt die Auflösung nicht. Mache ich hingegen ein:

root@kvm01:~# ping kolab.dental.lan
PING kolab.dental.lan (192.168.5.7) 56(84) bytes of data.
64 bytes from kolab.dental.lan (192.168.5.7): icmp_seq=1 ttl=64 time=0.136 ms
64 bytes from kolab.dental.lan (192.168.5.7): icmp_seq=2 ttl=64 time=0.163 ms
64 bytes from kolab.dental.lan (192.168.5.7): icmp_seq=3 ttl=64 time=0.162 ms
64 bytes from kolab.dental.lan (192.168.5.7): icmp_seq=4 ttl=64 time=0.174 ms
....
klappt alles.

Wo habe ich hier einen Fehler in meiner Konfiguration?

fork
07.04.16, 20:05
Die Preisfragen sind:

Was bewirkt der folgende Eintrag in /etc/network/interfaces tatsächlich?
(Sollte ja eigentlich in der manpage zu interfaces stehen)



...
dns-nameservers 192.168.5.1
dns-search dental.lan
...


Wofür ist die Datei /etc/resolv.conf da?
Welchen Zweck hat das Paket resolvconf?

Und wie hängt das jetzt alles zusammen?

Die Ubuntu-Wiki Seite zu /etc/network/interfaces (https://wiki.ubuntuusers.de/interfaces/) ist auf jeden Fall auch hilfreich.

DrunkenFreak
08.04.16, 07:30
Was sagt resolv.conf?

Zum Testen besser dig oder nslookup verwenden. Kriegst du ein paar mehr Informationen als mit ping.

blubbersuelze
08.04.16, 16:43
soweit ich das sehen fehlen hier die ORIGIN Einträge, was dann zu folgendem Content führen würde:

/etc/bind/db.dental.lan


$TTL 172800 ; 2 days
@ IN SOA kvm01.dental.lan. root.dental.lan. (
2016040701 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
2419200 ; expire (4 weeks)
10800 ; minimum (3 hours)
)
@ IN NS kvm01.dental.lan.
IN MX 10 kolab.dental.lan.
IN A 192.168.5.1

$ORIGIN dental.lan.

kvm01 IN A 192.168.5.1
ipfire IN A 192.168.5.5
tux IN A 192.168.5.6
kolab IN A 192.168.5.7


/etc/bind/db.5.168.192


$TTL 172800 ; 2 days
@ IN SOA kvm01.dental.lan. root.dental.lan. (
2016040701 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
2419200 ; expire (4 weeks)
172800 ; minimum (2 days)
)
@ IN NS kvm01.dental.lan.

$ORIGIN 5.168.192.in-addr.arpa.

1 IN PTR kvm01.dental.lan.
5 IN PTR ipfire.dental.lan.
6 IN PTR tux.dental.lan.
7 IN PTR kolab.dental.lan.

pixel
03.05.16, 17:02
war im Urlaub, deshalb melde ich mich erst jetzt.

Die Preisfragen sind:
Was bewirkt der folgende Eintrag in /etc/network/interfaces tatsächlich?
(Sollte ja eigentlich in der manpage zu interfaces stehen)


...
dns-nameservers 192.168.5.1
dns-search dental.lan
...


Wofür ist die Datei /etc/resolv.conf da?
Welchen Zweck hat das Paket resolvconf?

Und wie hängt das jetzt alles zusammen?

Die Ubuntu-Wiki Seite zu /etc/network/interfaces (https://wiki.ubuntuusers.de/interfaces/) ist auf jeden Fall auch hilfreich.

Also dort steht es doch genauso beschrieben.

Statische IP-Konfiguration
...
Ein Beispieleintrag hätte also folgende Form:

## Ethernet Schnittstelle 0
auto eth0
# Beim Bootvorgang automatisch starten
iface eth0 inet static
address 192.168.0.97
netmask 255.255.255.0
gateway 192.168.0.1
Optional kann bei dieser Methode noch der DNS-Server manuell gesetzt werden. Hierfür ist das Paket resolvconf erforderlich und folgender Eintrag:

dns-nameservers 192.168.0.1 10.10.0.2
Genauso funktioniert das für andere resolv.conf-Einträge wie z.B. die Suchdomäne:

dns-search domain.de

Wo habe ich hier einen Fehler?

pixel
03.05.16, 17:04
soweit ich das sehen fehlen hier die ORIGIN Einträge, was dann zu folgendem Content führen würde:

/etc/bind/db.dental.lan


$TTL 172800 ; 2 days
@ IN SOA kvm01.dental.lan. root.dental.lan. (
2016040701 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
2419200 ; expire (4 weeks)
10800 ; minimum (3 hours)
)
@ IN NS kvm01.dental.lan.
IN MX 10 kolab.dental.lan.
IN A 192.168.5.1

$ORIGIN dental.lan.

kvm01 IN A 192.168.5.1
ipfire IN A 192.168.5.5
tux IN A 192.168.5.6
kolab IN A 192.168.5.7




/etc/bind/db.5.168.192


$TTL 172800 ; 2 days
@ IN SOA kvm01.dental.lan. root.dental.lan. (
2016040701 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
2419200 ; expire (4 weeks)
172800 ; minimum (2 days)
)
@ IN NS kvm01.dental.lan.

$ORIGIN 5.168.192.in-addr.arpa.

1 IN PTR kvm01.dental.lan.
5 IN PTR ipfire.dental.lan.
6 IN PTR tux.dental.lan.
7 IN PTR kolab.dental.lan.


Ich habe den DNS nach dem Wiki im Ubuntu-Forum eingerichtet und gerade nochmal nachgeschaut. Dort werden diese Einträge nicht genannt. Was bewirken diese?

mbo
03.05.16, 17:13
Fehlen hier Beiträge?
Wenn Du z. B. ping host eingibst, wird geprüft, ob es einen Hosts-Eintrag gibt, danach werden die Resolver bemüht. Bei "host" sucht er als erstes nach search domain, die ranhängen kann, also Host.Domain.tld. Gibt es keine, wird aus host host. Und da wird kein Resolver was finden.

pixel
04.05.16, 07:32
Fehlen hier Beiträge?
Was meinst Du damit?

Fehlen hier Beiträge?
Wenn Du z. B. ping host eingibst, wird geprüft, ob es einen Hosts-Eintrag gibt
Also ich mache einen:

ping ipfire
er wird in /etc/hosts nachgeschaut

127.0.0.1 localhost
127.0.1.1 kvm01
192.168.5.1 kvm01.dental.lan kvm01
und da gibt es keinen entsprechenden Eintrag. Bis hierher ist mir alles klar.

danach werden die Resolver bemüht. Bei "host" sucht er als erstes nach search domain, die ranhängen kann, also Host.Domain.tld. Gibt es keine, wird aus host host. Und da wird kein Resolver was finden.
Er schaut also in /etc/resolv.conf

serach dental.lan
nameserver 192.168.5.1
und danach sollte er doch Domain.tld also dental.lan anhängen. Oder stehe ich jetzt total auf dem Schlauch?

mbo
04.05.16, 07:50
Nöö. Es sei denn, die Option heißt bei diesem Ubuntu tatsächlich serach und nicht search ...