How to install DNS Server (BIND)

Status
Not open for further replies.

swbartley

Explorer
Joined
Mar 17, 2014
Messages
58
I am trying to install BIND as my internal DNS server in a jail however I can't find the appropriate instructions on how to configure it correctly. Does anyone have a How-To or a Tutorial they could point me to? I'm not opposed to another DNS server option if there are some clear configuration directions.

Thanks in advance!!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
How to configure it?

Well I know they removed BIND from FreeBSD 10, so it's probably over in the jail's /usr/local after you install it. If you cannot find the configuration file, see if you can find it by using "find / -name 'named.conf*' -print" from within the jail. If you cannot figure the options to configure automatic startup, they're usually documented in the /usr/local/etc/rc.d/ script for it. For example, it might say that you need to set named_enable="YES" in /etc/rc.conf.

This should all be really simple so let us know where you're getting tripped up.
 

swbartley

Explorer
Joined
Mar 17, 2014
Messages
58
How to configure it?

Well I know they removed BIND from FreeBSD 10, so it's probably over in the jail's /usr/local after you install it. If you cannot find the configuration file, see if you can find it by using "find / -name 'named.conf*' -print" from within the jail. If you cannot figure the options to configure automatic startup, they're usually documented in the /usr/local/etc/rc.d/ script for it. For example, it might say that you need to set named_enable="YES" in /etc/rc.conf.

This should all be really simple so let us know where you're getting tripped up.

I was hoping the files for BIND would have the same names as other operating systems but just in a different location to edit but where I'm getting lost is which one's to configure. I'm coming from ubuntu server and I'm looking for named.conf.options, named.conf.local and db.local. The "named.conf" looks like its in /usr/local/etc/namedb/ which looks right when I open it but I need to figure out the rest of the files. I'm also setting up a primary and a slave DNS.

Here's what I have when I did the "find / -name 'named.conf*' -print"

/usr/ports/dns/bind910/files/named.conf.in
/usr/ports/dns/bind99/files/named.conf.in
/usr/ports/dns/bind9-devel/files/named.conf.in
/usr/local/man/man5/named.conf.5.gz
/usr/local/etc/namedb/named.conf
/usr/local/etc/namedb/named.conf.sample
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
The file you need to modify is /usr/local/etc/namedb/named.conf

named.conf.options, named.conf.local sound like made-up linux B.S. If you look in the named.conf on the linux box they're probably include directives from within named.conf.

No clue what "db.local" would be. Again, look in named.conf on the linux box.

It is very likely that you can pack up the files from your linux box and unpack them in /usr/local/etc/namedb, adjust pathnames accordingly, and be 99% of the way there.
 

swbartley

Explorer
Joined
Mar 17, 2014
Messages
58
The file you need to modify is /usr/local/etc/namedb/named.conf

named.conf.options, named.conf.local sound like made-up linux B.S. If you look in the named.conf on the linux box they're probably include directives from within named.conf.

No clue what "db.local" would be. Again, look in named.conf on the linux box.

It is very likely that you can pack up the files from your linux box and unpack them in /usr/local/etc/namedb, adjust pathnames accordingly, and be 99% of the way there.

The named.conf is definitely one of the files to edit however here's a link to an identical configuration with a few adjustments i'm trying to reconcile if my explanation wasnt very clear.
The link references the same files that I listed above but they are not in freenas which makes it a little difficult when the old config file names dont match the new one.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Okay, let me be very clear:

"There is only one configuration file for named. It is named.conf. Everything else derives from that. There is no named.conf.local, except insofar as one might be included by an include statement in named.conf."

So look inside your linux named.conf to see what's there, and if you like it, copy that over. Every other sub-configuration file, every zone file, every tsig configuration file, every key definition file, every ACL file, every other file is either included from or defined through named.conf. There is no particular standard for how this is done, and those of us who've been managing BIND since the 1980's each have our own preferred way to make the configuration manageable.

If you want a configuration subfile that does not exist, you can include it. Sticking

include "named.swbartley.conf"

into your named.conf file will cause BIND to include that file into the configuration. You can make the configuration look like whatever you please, that's part of what makes it "configuration."
 

swbartley

Explorer
Joined
Mar 17, 2014
Messages
58
I thought I had everything configured correctly but I am running into a little issue. I tested my config files when I moved them over to make sure there weren't any errors and that went ok but when I did a nslookup once I moved it over i get:
** server can't find 200.1.168.192.in-addr.arpa: NXDOMAIN
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Well, that implies that:

1) it's not configured correctly, or

2) that record isn't in the zone file, or

3) you're querying the wrong server
 

swbartley

Explorer
Joined
Mar 17, 2014
Messages
58
Well, that implies that:

1) it's not configured correctly, or

2) that record isn't in the zone file, or

3) you're querying the wrong server

Here's what's in my config files can you tell me whats missing?
 

Attachments

  • named.conf.txt
    1 KB · Views: 477
  • db.securenas.org.txt
    609 bytes · Views: 331
  • db.192.168.txt
    690 bytes · Views: 389

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
well, it looks like origin is wrong in db.192*, but I'm only about .2% awake.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
The cool kids use "unbound", not bind, in FreeNAS.

I have a video on how to install it on FreeNAS on YouTube. Search for "DrKK DNS" on youtube.
 

swbartley

Explorer
Joined
Mar 17, 2014
Messages
58
The cool kids use "unbound", not bind, in FreeNAS.

I have a video on how to install it on FreeNAS on YouTube. Search for "DrKK DNS" on youtube.
Thanks for the video I did watch it in its entirety and it was very informative but I'm using DNS for name resolution rather than for caching.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
The cool kids use "unbound", not bind, in FreeNAS.

Yes, the children use unbound. BIND is reserved for grownups, especially including anyone needing to get real work done.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Yes, the children use unbound. BIND is reserved for grownups, especially including anyone needing to get real work done.
lol.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Thanks for the video I did watch it in its entirety and it was very informative but I'm using DNS for name resolution rather than for caching.
Unbound has both a recursor, and an authoritative module for resolution. This is easily configured, check out the unbound documentation.
 
Status
Not open for further replies.
Top