Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem using bind with views

Posted on 2014-12-23
2
Medium Priority
?
198 Views
Last Modified: 2014-12-24
Hi.

I'm running a debian linux where I installed bind for using it as a DNS server.

I created some zones and it's working fine. Here is the named.conf.local

//
// Do any local configuration here
//

	zone "interna" {
		type master;
		file "/etc/bind/db.interna";
	};
	zone "7.16.172.in-addr.arpa" {
		type master;
		file "/etc/bind/db.172.16.7";
		notify no;
	};


	zone "serveis.interna" {
		type master;
		file "/etc/bind/db.serveis.interna";
		notify no;
	};

	zone "grup7.gsx" {
		type master;
		file "/etc/bind/db.dmz";
	};


	zone "70.168.192.in-addr.arpa" {
		type master;
		file "/etc/bind/db.192.168.70";
		notify no;
	};

	zone "71.168.192.in-addr.arpa" {
		type master;
		file "/etc/bind/db.192.168.71";
		notify no;
	};

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

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

Open in new window


Then I changed this file to use views:

//
// Do any local configuration here
//

view "intranet" {
//	recursion yes;
//	match-clients { 172.16.7.0/24; localhost;};
	zone "interna" {
		type master;
		file "/etc/bind/db.interna";
	};
	zone "70.168.192.in-addr.arpa" {
		type master;
		file "/etc/bind/db.192.168.70";
	};

	zone "71.168.192.in-addr.arpa" {
		type master;
		file "/etc/bind/db.192.168.71";
	};
//	include "/etc/bind/named.conf.default-zones";
};

view "public" {
//	match-clients { any; };
//	recursion no;

	zone "serveis.interna" {
		type master;
		file "/etc/bind/db.serveis.interna";
	};

	zone "grup7.gsx" {
		type master;
		file "/etc/bind/db.dmz";
	};

	zone "7.16.172.in-addr.arpa" {
		type master;
		file "/etc/bind/db.172.16.7";
		notify no;
	};

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

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

Open in new window


After this change, DNS seems to stop working (ping and dig fails when they worked before).  What is the problem on this version of the file?
0
Comment
Question by:gplana
2 Comments
 
LVL 21

Accepted Solution

by:
Daniel McAllister earned 2000 total points
ID: 40516432
OK, so first things first -- a ping test on the server failing means far more than DNS is stopping, which means far more is going on.

On the other hand, if you're using ping to test name resolution, and it's coming back unresolved, that's not a ping failure, that's a DNS failure.

The next thing I see is that you have totally different zones in the "intranet" and "public" views -- which means people on the 172.16.7.0/24 network -- and your localhost -- will NOT be able to resolve any of the "public" domains.

This is a common error -- an assumption that you'll see zones in any area you "match" -- but that is not at all true. Instead, you see the zones in the first "view" you match... and no others!

Why you might ask? For many sites, they have different "internal" views of the same domain that is also accessible from the Internet. For example:
  from the LAN: each server has a LAN IP and each desktop registers its DNS name when it gets a DHCP setup
  from the WAN: the same domain name resolves server addresses to WAN IPs, and there are no entries for desktops

SO -- redo the views with this in mind (meaning that everything in the "public" view should also be in the "intranet" view.

FWIW: I usually list these domains in an INCLUDE file so that my "intranet" view has an include for the public domains and the public view has the same include.

I hope this helps to solve your issue!

Dan
IT4SOHO
0
 
LVL 15

Author Closing Comment

by:gplana
ID: 40516489
Excellent. This was exactly the problem: my initial view should include all the zones, not just its exclusive zones.

Thank you so much.
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I wrote this article to explain some important DNS concepts that should be known to avoid some typical configuration errors I often see in forums. I assume that what is described here is the typical behavior of Microsoft DNS client. I don't know …
There have been a lot of times when we have seen the need to enter a large number of DNS entries in a forward lookup zone. The standard procedure would be to launch the DNS Manager console, create the Zone and start adding new hosts using the New…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question