Portál AbcLinuxu, 16. července 2025 07:56


Dotaz: DNS Bind8 a nastaveni local

15.7.2008 09:28 joudamAtEs
DNS Bind8 a nastaveni local
Přečteno: 385×
Odpovědět | Admin
Dobry den,

mame v nasi siti maly problem, pro me jako zacatecnika ve sprave linuxovych serveru docela velky, pro Vas odborniky myslim malickost. Jako firemni DNS server pouzivame Bind8 na OpenSuse8.

Mame pobockovou sit realizovanou pomoci VPN s jednim centralnim datovym centrem. Servery napr. SERVER03 nebo SERVER04 jsou umisteny v datovem centru v DMZ, s vnitrni adresou 10.1.255.237. Adresy pobocek jsou 10.1.rozsahpropobocku.x. Praha ma 10.1.7.x ... brno ma 10.1.5.x.

Dosud jsme pristupovali v aplikacich ke vsem serverum pomoci IP adres, coz funguje, routovani by melo byt nastevno vsude dobre.

Problem ale mame pri pristupu pres jmena, to je pravdepobodne nastaveno spatne na nasem DNS serveru. Pro specifikaci vnitrni site VPN pouzivame zonu firma.local. Kdyz zkusim ping na SERVER03, tam mi to dns server neprelozi. Preklad internetovych adres fuguje spravne, surfovani funguje celou dobu v poradku. Neco o DNS principech vim, objednal jsem si knizku ale poprosim jestli by jste mi nyni poradili.

Prikladam config soubory Bindu:
# Copyright (c) 2001 SuSE GmbH Nuernberg, Germany
#
# Author: Frank Bodammer 
#
# /etc/named.conf
#
# This is a sample configuration file for the name server BIND8. 
# It works as a caching only name server without modification.
#
# A sample configuration for setting up your own domain can be
# found in /usr/share/doc/packages/bind8/sample-config.
#
# A description of all available options can be found in
# /usr/share/doc/packages/bind8/html/options.html

options {

	# The directory statement defines the name server's 
	# working directory

	directory "/var/named";

	# The forwarders record contains a list of servers to
	# which queries should be forwarded. Enable this line and
	# modify the IP-address to your provider's name server.
	# Up to three servers may be listed.

	#forwarders { 10.11.12.13; 10.11.12.14; };

	# Enable the next entry to prefer usage of the name 
	# server declared in the forwarders section.

	#forward first;

	# The listen-on record contains a list of local network
	# interfaces to listen on. Optionally the port can be 
	# specified. Default is to listen on all interfaces found
	# on your system. The default port is 53.

	#listen-on port 53 { 127.0.0.1; };

	# The next statement may be needed if a firewall stands
	# between the local server and the internet.

	#query-source address * port 53;

	# The allow-query record contains a list of networks or
	# IP-addresses to accept and deny queries from. The 
	# default is to allow queries from all hosts.

	#allow-query { 127.0.0.1; };

	# The cleaning-interval statement defines the time interval
	# in minutes for periodic cleaning. Default is 60 minutes.
	# By default, all actions are logged to /var/log/messages.

	cleaning-interval 120;

	# Name server statistics will be logged to /var/log/messages
	# every <> minutes. Default is 60 minutes.
	# A value of 0 disables this feature.



	# If notify is set to yes (default), notify messages are
	# sent to other name servers when the the zone data is
	# changed. Instead of setting a global 'notify' statement
	# in the 'options' section, a separate 'notify' can be
	# added to each zone definition.

	notify no;
};

# The following three zone definitions don't need any modification.
# The first one defines localhost while the second defines the
# reverse lookup for localhost. The last zone "." is the 
# definition of the root name servers. 

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

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

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


# You can insert further zone records for your own domains below.


zone "firma.cz" IN { 
	type master;	
	file "firma.cz";
	allow-update {none;};
};

zone "firma.local" IN { 
	type master;	
	file "firma.local";
	allow-update {none;};

};

a dale firma.local (/var/named/firma.local)

$ORIGIN local.
firma	88400	IN	SOA	firma.local. nasISP.itsro.cz. (
			2008071402
			28800
			7200
			604800
			86400 )
firma.local.	88400	IN	NS	ns1.nasISP.cz
firma.local.	88400	IN	NS	ns2.nasISP.cz.
	88400	IN	MX	10 mx.firma.cz.
$ORIGIN firma.local.
cimelice 88400 IN	A	10.1.1.253
tabor	88400	IN	A	10.1.6.254
kralice	88400	IN	A	10.1.8.254
praha	88400	IN	A	10.1.7.254
brno	88400	IN	A	10.1.5.254
opatovice	88400	A	10.1.4.254
trutnov	88400	A	10.1.9.254
humpolec	88400	A	10.1.2.254
pruhonice	88400	A	10.1.3.254
zlin	88400	A	10.1.11.254
brno2	88400	A	10.1.12.254
olomouc	88400	A	10.1.10.254
server07.firma.local.	884000	IN	A	10.1.255.237
server03.firma.local.	884000	A	10.1.255.248
prd_app2	884000	A	10.1.254.79

Na zaver uvadim, ze tenhle Bind nastavoval asi pred 3 roky nejaky technik od naseho ISP.

Budu moc vdecny kdyz mi s tim pomuzete, tusim ze to bude nastaveno spatne nebo ze tam neco uplne chybi, napr. je mi divne ze nejsou uvedeny forwardery.

Diky joudamAtEs
Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

15.7.2008 11:02 Ripper | skóre: 31
Rozbalit Rozbalit vše Re: DNS Bind8 a nastaveni local
Odpovědět | | Sbalit | Link | Blokovat | Admin
Určitě si ujasněte, jestli ta zóna bude firma.local nebo jen firma či local. Takto to není zřejmé.

Takže například pro zónu firma by konfigurák /var/named/firma.local vypadal takto:
$ORIGIN firma.
firma	88400	IN	SOA	firma. (emailnaodpovědnouosobu). (
			2008071402
			28800
			7200
			604800
			86400 )
firma.	88400	IN	NS	ns1.firma.
firma.	88400	IN	NS	ns2.firma.
	88400	IN	MX	10 mx.firma.cz.

ns1 88400 IN	A	(IPprimárníhoDNS)
ns2 88400 IN	A	(IPsekundárníhoDNS)
cimelice 88400 IN	A	10.1.1.253
tabor	88400	IN	A	10.1.6.254
kralice	88400	IN	A	10.1.8.254
praha	88400	IN	A	10.1.7.254
brno	88400	IN	A	10.1.5.254
opatovice	88400	A	10.1.4.254
trutnov	88400	A	10.1.9.254
humpolec	88400	A	10.1.2.254
pruhonice	88400	A	10.1.3.254
zlin	88400	IN      A	10.1.11.254
brno2	88400	A	10.1.12.254
olomouc	88400	A	10.1.10.254
server07	884000	IN	A	10.1.255.237
server03	884000	A	10.1.255.248
prd_app2	884000	A	10.1.254.79
Nezapomeňte také na reverzní záznamy. TAky nechápu, proč má každý záznam v zóně mít jiné TTL.

Výsledek potom bude vypadat třeba pro stroj s IP 10.1.255.248 bude jméno server03.firma

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.