• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

DHCP Clients automatisch in DNS eintragen

Hallo

ich verusche zu Hause unseren DHCP Server und DNS Server von der Arbeit nachzubauen um die Probleme auf der Arbeit nachzuvollziehen.

Nun zuerst zu meinem Problem.

Ich habe einen DHCP und einen DNS Server aufgesetzt und konfigueriert. Beides funktioniert alleine, jedoch zusammen nicht. Der DHCP Server trägt nichts in den DNS ein. Es kommt auch keine FM im Log. Entweder wissen die Beiden nichts voneinander (obwohl beides auf der gleichen Maschine läuft) oder der DHCP trägt es nicht in den DNS ein.

Hier meine Configs

Code:
# /etc/dhcp.conf

option broadcast-address 192.168.10.255;
option subnet-mask 255.255.255.0;
option routers 192.168.10.1;

option domain-name-servers 192.168.10.200;

ddns-update-style interim;
ddns-domainname "home";
update-static-leases true;

key DHCP_UPDATER {
        algorithm HMAC-MD5.SIG-ALG.REG.INT;
        secret PPaCElmpe7+QTEDDjIKaQw==;
        };
        zone 10.168.192.in-addr.arpa. {
            primary 192.168.10.200;
            key DHCP_UPDATER;
        }
        zone home. {
                primary 192.168.10.200;
                key DHCP_UPDATER;
        }
autoritative;

subnet 192.168.10.0 netmask 255.255.255.0 {
        range 192.168.10.190 192.168.10.195;
        default-lease-time 86400;
        max-lease-time 86400;
        option domain-name-servers 192.168.10.200;
}

group VMs {
        host win-VM1 {
                hardware ethernet 00:0C:29:77:96:CF;
                fixed-address 192.168.10.222;
        }
}

Code:
# /etc/dhcp.conf

option broadcast-address 192.168.10.255;
option subnet-mask 255.255.255.0;
option routers 192.168.10.1;

option domain-name-servers 192.168.10.200;

ddns-update-style interim;
ddns-domainname "home";
update-static-leases true;

key DHCP_UPDATER {
        algorithm HMAC-MD5.SIG-ALG.REG.INT;
        secret PPaCElmpe7+QTEDDjIKaQw==;
        };
        zone 10.168.192.in-addr.arpa. {
            primary 192.168.10.200;
            key DHCP_UPDATER;
        }
        zone home. {
                primary 192.168.10.200;
                key DHCP_UPDATER;
        }
autoritative;

subnet 192.168.10.0 netmask 255.255.255.0 {
        range 192.168.10.190 192.168.10.195;
        default-lease-time 86400;
        max-lease-time 86400;
        option domain-name-servers 192.168.10.200;
}

group VMs {
        host win-VM1 {
                hardware ethernet 00:0C:29:77:96:CF;
                fixed-address 192.168.10.222;
        }
}

Log

Code:
Nov 11 16:19:18 srv-mail named[4120]: starting BIND 9.3.2 -t /var/lib/named -u named
Nov 11 16:19:18 srv-mail named[4120]: found 1 CPU, using 1 worker thread
Nov 11 16:19:18 srv-mail named[4120]: loading configuration from '/etc/named.conf'
Nov 11 16:19:18 srv-mail named[4120]: listening on IPv4 interface lo, 127.0.0.1#53
Nov 11 16:19:18 srv-mail named[4120]: listening on IPv4 interface eth0, 192.168.10.200#53
Nov 11 16:19:18 srv-mail named[4120]: command channel listening on 127.0.0.1#953
Nov 11 16:19:18 srv-mail named[4120]: command channel listening on ::1#953
Nov 11 16:19:18 srv-mail named[4120]: zone 0.0.127.in-addr.arpa/IN: loaded serial 42
Nov 11 16:19:18 srv-mail named[4120]: zone 10.168.192.in-addr.arpa/IN: loaded serial 22
Nov 11 16:19:18 srv-mail named[4120]: zone home/IN: loaded serial 1
Nov 11 16:19:18 srv-mail named[4120]: zone localhost/IN: loaded serial 42
Nov 11 16:19:18 srv-mail named[4120]: running
Nov 11 16:20:03 srv-mail dhcpd: Internet Systems Consortium DHCP Server V3.0.3
Nov 11 16:20:03 srv-mail dhcpd: Copyright 2004-2005 Internet Systems Consortium.
Nov 11 16:20:03 srv-mail dhcpd: All rights reserved.
Nov 11 16:20:03 srv-mail dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Nov 11 16:20:03 srv-mail dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Nov 11 16:20:03 srv-mail dhcpd: Internet Systems Consortium DHCP Server V3.0.3
Nov 11 16:20:03 srv-mail dhcpd: Copyright 2004-2005 Internet Systems Consortium.
Nov 11 16:20:03 srv-mail dhcpd: All rights reserved.
Nov 11 16:20:03 srv-mail dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Nov 11 16:20:03 srv-mail dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Nov 11 16:20:03 srv-mail dhcpd: Wrote 0 group decls to leases file.
Nov 11 16:20:03 srv-mail dhcpd: Wrote 0 deleted host decls to leases file.
Nov 11 16:20:03 srv-mail dhcpd: Wrote 0 new dynamic host decls to leases file.
Nov 11 16:20:03 srv-mail dhcpd: Wrote 1 leases to leases file.
Nov 11 16:20:03 srv-mail dhcpd: Listening on LPF/eth0/00:0c:29:ec:57:8b/192.168.10/24
Nov 11 16:20:03 srv-mail dhcpd: Sending on   LPF/eth0/00:0c:29:ec:57:8b/192.168.10/24
Nov 11 16:20:03 srv-mail dhcpd: Sending on   Socket/fallback/fallback-net


jetzt scheint er was zu machen, hab die config wie hier im Forum beschrieben angepasst. Es kommt ncoh eine FM, aber das werde ich wohl noch schaffen

Code:
Nov 11 16:27:06 srv-mail named[4120]: client 192.168.10.200#32776: updating zone 'home/IN': error: journal open failed: unexpected error

So nachdem ich das Journalfile erstellt habe und es die richtigen Berechtigungen erhalten hat, habe ich nur noch diese Meldung

Code:
Nov 11 16:37:36 srv-mail dhcpd: Unable to add forward map from Win-VM1.home to 192.168.10.222: timed out

Besten Dank für eure Hilfe

Killtill
 
ja, habe nochmals zur Sicherheit den Key im etc gelöscht und nochmals einen neuen erstellt und diesen in beide confs eingetragen...

es tut immer noch nicht... HILFE
 
ich dachte der Key wird hier gespeichert in diesen Files

Code:
srv-mail:/etc # ls Kdhcp_updater.* -lah
-rw------- 1 root root 54 Nov 11 19:23 Kdhcp_updater.+157+51607.key
-rw------- 1 root root 81 Nov 11 19:23 Kdhcp_updater.+157+51607.private

Die sehen so aus

Code:
srv-mail:/etc # cat Kdhcp_updater.+157+51607.*
DHCP_UPDATER. IN KEY 0 3 157 JkIKVH6ETqSFxH5dAKTDdQ==
Private-key-format: v1.2
Algorithm: 157 (HMAC_MD5)
Key: JkIKVH6ETqSFxH5dAKTDdQ==

Habe gesehen das es die rndc.key Datei in /etc und /var/lib/named/etc hat. Habe beide mal angepasst

Orginal sahen sie so aus:

Code:
srv-mail:/etc # cat rndc.old
key "rndc-key" {
        algorithm hmac-md5;
        secret "hEYzrGwc92Qq+VBOCp7etpULw+I01UYI5j5yD8U6xldMm2KownxeX9mUQcqlaHB3LLyBgIVTft3DFyQtCNkkpg==";
};

Habe sie nun mit dem erstellten Schlüssel angepasst:

Code:
key "rndc-key" {
        algorithm hmac-md5;
        secret "JkIKVH6ETqSFxH5dAKTDdQ==";
};

Beide Dienste neu gestartet, jedoch kommt immer noch die selbe FM -> timeout.

Soll ich dir meine Daten geben, dass du per ssha uf den rechner schauen kannst?

Gruss

killtill
 
Code:
NAMED_CONF_INCLUDE_FILES="/etc/ddns.key /etc/named.d/*"
diese Zeile solltest du in /etc/sysconfig/named haben, damit der named auf die ddns.key von /etc nach /var/lib/named/etc/ zieht. Weil sonst ist klar, ohne Key = authorization failure = klappte halten und Timeout.
 
Hab ich mal so eingetragen, aber es kommt immer noch ein timeout. Ich werde aus der FM timeout nicht schlau, kann ich das Loglevel oder sonst was hochschrauben, damit ich genau verstehe, was mir das liebe Linux mit dem Timeout mitzuteilen versucht... hast du noch weitere vorschläge, oder möchtest du mal auf mein System gucken?

Heri die named


Code:
srv-mail:/etc/sysconfig # cat named
## Path: Network/DNS/Name Server
## Description: Names server settings

## Type: yesno
## Default: yes
## ServiceRestart: lwresd,named
#
# Shall the DNS server 'named' or the LightWeight RESolver Daemon, lwresd run
# in the chroot jail /var/lib/named/?
#
# Each time you start one of the daemons with the init script, /etc/named.conf,
# /etc/named.conf.include, /etc/rndc.key, and all files listed in
# NAMED_CONF_INCLUDE_FILES will be copied relative to /var/lib/named/.
#
# The pid file will be in /var/lib/named/var/run/named/ and named named.pid
# or lwresd.pid.
#
NAMED_RUN_CHROOTED="yes"

## Type: string
## Default: ""
## ServiceRestart: lwresd,named
#
# Additional arguments when starting the name daemon with the init script
# /etc/init.d/named or rcnamed.
#
# For example "-n 2" to use two CPUs if named is unable to determine the
# number of available CPUs.
#
# See man 8 named for all available commandline options.
#
# "-t /var/lib/named/var" is added if NAMED_RUN_CHROOTED is set to yes.
#
# "-u named" is used in any case by the init script to run the named daemon as
# user 'named' after completing privileged operations.
#
NAMED_ARGS=""
## Type: string
## Default: ""
## ServiceReload: named
#
# All mentioned config files will be copied relativ to /var/lib/named/, when
# 'named' is started in the chroot jail.
#
# /etc/named.conf and /etc/rndc.key are always copied.  Also all files from
# include statements in named.conf.
#
# Filenames can be relative to /etc/named.d/.
#
# Please take care of the order if one file needs a setting of another.
#
# Example: "/etc/named-dhcpd.key ldap.dump rndc-access.conf"
#
NAMED_CONF_INCLUDE_FILES="/etc/rndc.key /etc/named.d/*";

## Type: string
## Default: "createNamedConfInclude"
## ServiceReload: named
#
# Programms to be executed each time the DNS server 'named' is started or
# reloaded.
#
# Filenames can be relative to /usr/share/bind/.
#
NAMED_INITIALIZE_SCRIPTS="createNamedConfInclude"
srv-mail:/etc/sysconfig #

Gruss

Killtill[/code]
 
OMG wie peinlich, bei meinem ersten Post habe ich 2 mal dhcp.conf gepostet...sorry

Code:
# /etc/named.conf

options {
        directory "/var/lib/named/dyn";
        forwarders {62.2.24.158;};
        notify no;
        listen-on port 53 { 192.168.10.200;127.0.0.1; };

};

zone "localhost" in {
        type master;
        allow-update { none; };
        file "localhost.zone";
};

zone "0.0.127.in-addr.arpa" in {
        type master;
        allow-update { none; };
        file "127.0.0.zone";
};

zone "." in {
        type hint;
        file "root.hint";
};

key DHCP_UPDATER {
        algorithm HMAC-MD5.SIG-ALG.REG.INT;
        secret "JkIKVH6ETqSFxH5dAKTDdQ==";
};

zone "home" in {
        type master;
        allow-update { 192.168.10.20/24;key DHCP_UPDATER; };
        file "home.zone";
};


zone "10.168.192.in-addr.arpa" in {
        type master;
        allow-update {192.168.10.20/24;key DHCP_UPDATER; };
        file "192.168.10.0.zone";
};
 
ja die installation war ziehlich vergurckt, habe nochmals nach anleitung von

http://sipx-wiki.calivia.com/index.php/HowTo_Configure_DHCP_and_DNS_Servers

nochmals gemacht und so hats funktioniert. Was ich nicht ganz schnalle ist das Verzeichnis var/lib/named/dyn wofüer ist es, für dynamische DNS einträge?

Noch eine kleine frage, was meinst du mit chroot und wie schalte ich es ab? Ich habe im Log gesehen das der DHCP immer mit chroot gestartet wird.

Besten Dank für eure Hilfe
 
Mein Tip: chroot richtig machen. Dann ist auch die Kiste sicherer als ohne (was meint ihr wohl, warum in Programmen chroots eingefügt werden? Na klar - weil die Entwickler gewisser Programme immer Probleme mit Ausbrüchen hatten.)
 
Code:
NAMED_RUN_CHROOTED="yes"
ändern in
Code:
NAMED_RUN_CHROOTED="no"
Klar ist es mit chroot sicherer, aber wenns so vergurkt ist ist es erstmal erste Hilfe.
Wenns dann geht kann man auch chroot richtig bauen. Die Frage ist nur: lohnt es sich, wenn der Server eh schon sicher steht...
 
killtill schrieb:
Ich kann das Problem mit dem Timeout leider nicht lösen und wäre für jegliche Hilfe dankbar.

Timeout kenne ich wenn die zoen dateien entweder
defekt sind,
falsche Rechte habe,
jnl-Files nicht vorhanden sind oder defekt sind.
der Updated allowed Schalter von irgendwem gelöscht wurde

gruß
 
Oben