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

DHCP soll DNS Updaten

Hallo habe folgendes Problem.
Benutze Suse Linux 9.3 auf dem ich einen DHCP und DNS Server laufen hab.
DHCP funktioniert und DNS auch, jedoch muss ich im DNS Server jedem Host eine Ip zuweisen in der Konfigurationsdatei.
Das funktioniert soweit auch. Jedoch hätte ich es gerne das mein Linux Client der neu ans Netz geht sich automatisch wenn er eine Ip von DHCP bekommt sich im DNS einträgt und die Namensauflösung funktioniert.

Ich hab gelesen das das mit einem Windows Client funktioniert geht das auch mit einem Linux Client?

Verwende Bind als DNS Server.

Danke im Vorraus
mfg
 

nbkr

Guru
http://www.pl-berichte.de/t_netzwerk/dhcpunddns.html

Besser ist das:
http://lists.suse.com/archive/suse-linux/2003-Oct/3320.html
 
OP
ichrootdunix

ichrootdunix

Newbie
Ok ich hab die änderungen an meiner dhcpd.conf und named.conf gemacht wie es hier http://www.pl-berichte.de/t_netzwerk/dhcpunddns.html
aufgeführt ist. Aber es funktioniert nicht!

1. Es steht am Ende des Textes das ich jetzt nur noch die Zone dateien erstellen muss und fertig. Weis leider nicht wie ich das machen soll.

2. Hab ich gelesen das ich am Client auch noch änderungen machen muss. Habe in der /etc/sysconfig/network auch eine Datei gefunden wo ich den Client einstellen muss.

An einer Stelle dieser Datei kann ich auch den Client wechseln zwichen:
dhcpcd und dhclient

Wenn ich den dhclient benutzen will bekomm ich beim hochfahren vom Client einen Error in den logs das ich diesen noch installieren muss. Brauch ich den überhaupt oder gehts auch mit dem dhcpcd?

3. MEine Configs:

Code:
# /etc/named.conf


options {
				
	auth-nxdomain yes;

	directory "/var/lib/named";
				
	

	dump-file "/var/log/named_dump.db";
	statistics-file "/var/log/named.stats";
				
	





	listen-on-v6 { any; };
				


	


	
	include "/etc/named.d/forwarders.conf";
};



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

zone "localhost" in {
	type master;
	file "localhost.zone";
};

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



include "/etc/named.conf.include";
logging {
	category default { log_syslog; };
	channel log_syslog { syslog; };
};



key DHCP_UPDATER {
	algorithm HMAC-MD5.SIG-ALG.REG.INT;
	secret J+YIQmWGQMEWDBrK93wT8A==;
	};


zone "allinone.de" in {
	file "master/allinone.de";
	type master;
	allow-update {key DHCP_UPDATER; };
	notify yes;
	allow-transfer { any; localhost; };
};


zone "0.168.192.in-addr.arpa" {
	file "master/0";
	type master;
	allow-update {key DHCP_UPDATER; };
	notify yes;
	allow-transfer { any; localhost; };
};
zone "1.168.192.in-addr.arpa" {
	file "master/1";
	type master;
	allow-update {key DHCP_UPDATER; };
	notify yes;
	allow-transfer { any; localhost; };
};



dhcpd.conf

Code:
option netbios-name-servers 192.168.0.1;

ddns-update-style interim;
ddns-domainname "allinone.de";
update-static-leases true;


key DHCP_UPDATER {
    algorithm HMAC-MD5.SIG-ALG.REG.INT;
    secret J+YIQmWGQMEWDBrK93wT8A==;
    };
    zone allinone.de. {
    primary 192.168.0.1;
    key DHCP_UPDATER;
    }

authoriative;

default-lease-time 2678400;
max-lease-time 7200;

subnet 192.168.0.0 netmask 255.255.254.0 {
option domain-name-servers 192.168.0.1;
option routers 192.168.0.1;
option domain-name "allinone.de";
option ntp-servers 192.168.0.1;
option lpr-servers 192.168.0.1;
range 192.168.0.100 192.168.1.254;

}


Auszug von /var/log/messages
Code:
Aug  3 09:58:28 linux-server dhcpd: Internet Systems Consortium DHCP Server V3.0.2
Aug  3 09:58:28 linux-server dhcpd: Copyright 2004 Internet Systems Consortium.
Aug  3 09:58:28 linux-server dhcpd: All rights reserved.
Aug  3 09:58:28 linux-server dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Aug  3 09:58:28 linux-server dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Aug  3 09:58:28 linux-server dhcpd: Internet Systems Consortium DHCP Server V3.0.2
Aug  3 09:58:28 linux-server dhcpd: Copyright 2004 Internet Systems Consortium.
Aug  3 09:58:28 linux-server dhcpd: All rights reserved.
Aug  3 09:58:28 linux-server dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Aug  3 09:58:28 linux-server dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Aug  3 09:58:28 linux-server dhcpd: Wrote 1 leases to leases file.
Aug  3 09:58:28 linux-server dhcpd: Listening on Socket/eth0/192.168.0/23
Aug  3 09:58:28 linux-server dhcpd: Sending on   Socket/eth0/192.168.0/23
Aug  3 09:58:28 linux-server dhcpd: Sending on   Socket/fallback/fallback-net
Aug  3 09:58:28 linux-server dhcpd: There's already a DHCP server running.
Aug  3 09:58:28 linux-server dhcpd: 
Aug  3 09:58:28 linux-server dhcpd: If you did not get this software from ftp.isc.org, please
Aug  3 09:58:28 linux-server dhcpd: get the latest from ftp.isc.org and install that before
Aug  3 09:58:28 linux-server dhcpd: requesting help.
Aug  3 09:58:28 linux-server dhcpd: 
Aug  3 09:58:28 linux-server dhcpd: If you did get this software from ftp.isc.org and have not
Aug  3 09:58:28 linux-server dhcpd: yet read the README, please read it before requesting help.
Aug  3 09:58:28 linux-server dhcpd: If you intend to request help from the dhcp-server@isc.org
Aug  3 09:58:28 linux-server dhcpd: mailing list, please read the section on the README about
Aug  3 09:58:28 linux-server dhcpd: submitting bug reports and requests for help.
Aug  3 09:58:28 linux-server dhcpd: 
Aug  3 09:58:28 linux-server dhcpd: Please do not under any circumstances send requests for
Aug  3 09:58:28 linux-server dhcpd: help directly to the authors of this software - please
Aug  3 09:58:28 linux-server dhcpd: send them to the appropriate mailing list as described in
Aug  3 09:58:28 linux-server dhcpd: the README file.
Aug  3 09:58:28 linux-server dhcpd: 
Aug  3 09:58:28 linux-server dhcpd: exiting.
Aug  3 10:10:28 linux-server named[12359]: client 192.168.0.1#1045: updating zone 'allinone.de/IN': adding an RR at 'linux-client.allinone.de' A
Aug  3 10:10:28 linux-server named[12359]: client 192.168.0.1#1045: updating zone 'allinone.de/IN': adding an RR at 'linux-client.allinone.de' TXT
Aug  3 10:10:28 linux-server named[12359]: journal file master/allinone.de.jnl does not exist, creating it
Aug  3 10:10:28 linux-server named[12359]: master/allinone.de.jnl: create: permission denied
Aug  3 10:10:28 linux-server named[12359]: client 192.168.0.1#1045: updating zone 'allinone.de/IN': error: journal open failed: unexpected error
Aug  3 10:10:28 linux-server dhcpd: Unable to add forward map from linux-client.allinone.de to 192.168.1.254: timed out
Aug  3 10:10:28 linux-server dhcpd: DHCPREQUEST for 192.168.1.254 from 00:30:05:56:c3:b6 (linux-client) via eth0
Aug  3 10:10:28 linux-server dhcpd: DHCPACK on 192.168.1.254 to 00:30:05:56:c3:b6 (linux-client) via eth0


Freu mich über jede tipps!!!
Danke im Vorraus!
mfg
 
OP
ichrootdunix

ichrootdunix

Newbie
Ok habs geschafft!
Für alle die das Problem auch haben:

Ihr müsst eure Zone Datei in /var/lib/named/dyn verschieben, und natürlich in der named.conf den pfad anpassen.

Noch eine Frage hab ich:
Bekomm ne Fehlermeldung:

unable to add reverse map from ....... destination required.

Jemand ein Tip ?

mfg
 

nbkr

Guru
Die Reversemap ist das Gegenteil der Forwardmap. In der Forwardmap steht drin:

deinname.test.local -> Deine IP

Entsprechend steht in der reversemap

ip -> name

Hast Du eine entsprechende Reversemap angelegt?
 
OP
ichrootdunix

ichrootdunix

Newbie
Ok,

die Reverse Zone Datei hab ich. Ich denke ich hab aber noch einen Fehler drin:

Die normale Zone:

Code:
$ORIGIN .
$TTL 172800	; 2 days
allinone.de		IN SOA	linux-server.allinone.de. root.linux-server.allinone.de. (
				2005071502 ; serial
				10800      ; refresh (3 hours)
				3600       ; retry (1 hour)
				604800     ; expire (1 week)
				86400      ; minimum (1 day)
				)
			NS	linux-server.allinone.de.
$ORIGIN allinone.de.
$TTL 3600	; 1 hour
labibjor02		A	192.168.0.255
			TXT	"3128c57693dde2122f41d633e1e8be4638"
linux-client		A	192.168.1.254
			TXT	"31e253891cacd9373a8e1cd34885926b4c"
$TTL 172800	; 2 days
linux-server		A	192.168.0.1

und die Reverse

Code:
$TTL 2d
@		IN SOA		linux-server.allinone.de.	root.linux-server.allinone.de. (
				2005071500	; serial
				3h		; refresh
				1h		; retry
				1w		; expiry
				1d )		; minimum

		 NS		linux-server.allinone.de.

192.168.0.1	IN A		linux-server.
 

nbkr

Guru
Ich hab gerade keinen Nameserver da um zu schauen, aber ich glaube das:
Code:
192.168.0.1   IN A      linux-server.
müsste so heißen:
Code:
192.168.0.1   IN A      linux-server.allinone.de.
 
OP
ichrootdunix

ichrootdunix

Newbie
Was sagt mir die Fehlermeldung ?

Aug 3 16:31:48 linux-server named[15014]: starting BIND 9.3.1 -t /var/lib/named -u named
Aug 3 16:31:48 linux-server named[15014]: found 1 CPU, using 1 worker thread
Aug 3 16:31:48 linux-server named[15014]: loading configuration from '/etc/named.conf'
Aug 3 16:31:48 linux-server named[15014]: listening on IPv6 interfaces, port 53
Aug 3 16:31:48 linux-server named[15014]: listening on IPv4 interface lo, 127.0.0.1#53
Aug 3 16:31:48 linux-server named[15014]: listening on IPv4 interface eth0, 192.168.0.1#53
Aug 3 16:31:48 linux-server named[15014]: command channel listening on 127.0.0.1#953
Aug 3 16:31:48 linux-server named[15014]: command channel listening on ::1#953
Aug 3 16:31:48 linux-server named[15014]: zone 0.0.127.in-addr.arpa/IN: loaded serial 42
Aug 3 16:31:48 linux-server named[15014]: dns_rdata_fromtext: dyn/reverse:11: near 'linux-server.allinone.de': bad dotted q uad
Aug 3 16:31:48 linux-server named[15014]: zone 0.168.192.in-addr.arpa/IN: loading master file dyn/reverse: bad dotted quad
Aug 3 16:31:48 linux-server named[15014]: zone allinone.de/IN: loaded serial 2005071504
Aug 3 16:31:48 linux-server named[15014]: zone localhost/IN: loaded serial 42
Aug 3 16:31:48 linux-server named[15014]: running
 
OP
ichrootdunix

ichrootdunix

Newbie
Ok vielen Dank "nbkr".

Funktioniert jetzt alles. Nachdem ich den statischen Eintrag entfernt hatte bekam ich keine Fehlermeldung mehr.

Und nach neustart des Servers(leerung des journals) funktionierte auch das nslookup.

mfg
 
Oben