LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-14-2007, 06:06 PM   #1
Jukas
Member
 
Registered: Mar 2005
Posts: 141

Rep: Reputation: 15
Questions on setting up BIND


I'm setting up BIND on a Debian 4.0 server. My understanding is that on Debian, the named service is chrooted by default running from /usr/sbin/named /var/lib/named. Looking at the running processes on my box shows

Code:
bind     11618  0.0  0.3  30556  3192 ?        Ssl  Mar15   0:01 /usr/sbin/named -u bind -t /var/lib/named
The question I'm running into is where to put my db.domain.com files? By default I show all the db.0 db.local db.root in the /var/lib/named/etc/bind directory but when I search named.conf.options the directory statement says

Code:
named.conf.options:     directory "/var/cache/bind";
So lets say I'm trying to manage the zone file for db.widgets.com My understanding is as-is I'd have to put db.widgets.com in /var/cache/bind but will the chrooted version installed on Debian be able to read it? If not, where should I put it?
 
Old 05-15-2007, 09:21 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Try it? Put wrong lines in the file and see which one is taken?

I don't use bind so I'll talk on a general level.
If the options are read before bind calls chroot() then just leave the file where it is.
Otherwise you need to create the /var/cache/bind under the chroot root.
A chrooted process CAN NOT access anything outside its root dir (a directory outside the root dir can be mapped inside the root dir with a special mount option though)
You can check the root dir of a process like this:

sudo ls -l /proc/`pidof bind`/root

lrwxrwxrwx 1 root root 0 2007-05-15 16:19 /proc/3514/root -> /

Example here the process with id 3514 has its root set to / which means it's not chrooted.
Beware that a process can have children. Some maybe chrooted, some not..
 
Old 05-15-2007, 09:33 AM   #3
Jukas
Member
 
Registered: Mar 2005
Posts: 141

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by nx5000
Try it? Put wrong lines in the file and see which one is taken?

I don't use bind so I'll talk on a general level.
If the options are read before bind calls chroot() then just leave the file where it is.
Otherwise you need to create the /var/cache/bind under the chroot root.
A chrooted process CAN NOT access anything outside its root dir (a directory outside the root dir can be mapped inside the root dir with a special mount option though)
You can check the root dir of a process like this:

sudo ls -l /proc/`pidof bind`/root

lrwxrwxrwx 1 root root 0 2007-05-15 16:19 /proc/3514/root -> /

Example here the process with id 3514 has its root set to / which means it's not chrooted.
Beware that a process can have children. Some maybe chrooted, some not..
Yup, I've already done that.. which shows

Code:
$ sudo ls -l /proc/`pidof named`/root
lrwxrwxrwx 1 bind bind 0 2007-05-15 07:29 /proc/4104/root -> /var/lib/named

I guess the real question is is there any harm in creating /var/lib/named/etc/bind/zone (/var/lib/named/etc/bind is already present) and putting the zone data files there? Considering the chrooted bind would already be able to access those directories I can't think of any reason not to, but I may be missing something.
 
Old 05-15-2007, 09:39 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
No I don't see any harm.
You just need to be sure that the chroot is issued before reading the configuration file.
Put garbage in the chrooted one and see if it is read.
 
Old 05-15-2007, 10:21 PM   #5
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
I don't think Debian puts BIND in a chroot, but I always install BIND from source, so I can't be certain.

In any case, you can put the zone file anywhere you want that the user named can read. You can specify a different location than the default in the named.conf file, and can probably find the location of the chroot if such a thing exists there as well.

Peace,
JimBass
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up DNS using BIND graq Linux - Server 17 12-22-2006 05:15 AM
Setting up bind and named trebek Linux - Networking 7 12-04-2006 02:15 PM
setting up bind KoopaTroopa Linux - Newbie 4 05-08-2004 07:00 PM
trouble setting up BIND noisybastard Linux - Networking 1 05-15-2003 06:36 AM
Setting up bind 9.2.1 jose_bravo Linux - Networking 2 12-29-2002 06:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration