# Check if DNS Bind is already installed?



## dinemuatta (Jul 14, 2015)

Hiho!

How can iI check if there is already a DNS Bind configured?

And if there is already one, how can iI activate it?

Please mention, iI'm a huge noob in BSD and now should look this up on the BSDFreeBSD Server of a company.


----------



## hukadan (Jul 14, 2015)

Have you read this already : 29.7 Domain Name System ?


----------



## dinemuatta (Jul 14, 2015)

Yes and iI also read/watched some tutorials how to bind a DNS. But iI just want to know what is the command to check if there is already a bind or how to activate it,
because this BSD server was supported by another IT-Company and we think that there already is a DNS configured but deactivated.

I'm sorry I am really a big noob. And why on earth is there no GUI? I hate this command stuff.


----------



## hukadan (Jul 14, 2015)

First note that BIND has been replaced by Unbound in FreeBSD 10.1 and later. Which version of FreeBSD are you running ? In the following, I assume you run a FreeBSD version prior to 10.1.



dinemuatta said:


> command to check if there is already a bind


I think `service -e` is what you are looking for. From service(8) :


> -e  List services that are enabled.  The list of scripts to check is com‐
> piled using rcorder(8) the same way that it is done in rc(8), then
> that list of scripts is checked for an "rcvar" assignment.  If
> present the script is checked to see if it is enabled.


If you have BIND on your system but it is not running, you can launch it with `service named onestart`. To ensure the daemon is launched at boot, put the following line in your /etc/rc.conf :

```
named_enable="YES"
```
Everything I just wrote was on the page I gave you. If this is not the answer to your question, could you be more specific ?


----------



## ShelLuser (Jul 14, 2015)

dinemuatta said:


> How can iI check if there is already a DNS Bind configured?


You can check if something has been installed on your system using the pkg command. When using it to search for info you'd use pkg-info(8), and its -x parameter allows you to search for partial names ('regular expression'). So to check if Bind (also often referred to as 'Named') has been installed you'd use: `$ pkg info -x bind`.

As hinted above by hukadan you can use the service command to check if a service has been activated.

Note that by default FreeBSD 10.x does not provide Bind anymore. Previous versions of FreeBSD (9.3 and 8.4 for example) did provide this, but fortunately installing Bind is very easy.

So on 10.x one solid way to check if Bind has been installed and configured would be to check its configuration file: /usr/local/etc/namedb/named.conf.

My guess, if you installed FreeBSD 10.1 then you won't have the Bind nameserver installed but you can use Unbound for regular lookups. Instead of using the commonly known dig command you'd use drill instead.

Installing Bind can be as easy as installing the port. In a nutshell:

```
# cd /usr/ports/dns/bind910
# make install clean
```
This is provided that you actually got the Ports collection installed and that the machine has Internet access.

Hope this can help too.


----------



## kpa (Jul 14, 2015)

ShelLuser said:


> So on 10.x one solid way to check if Bind has been installed and configured would be to check its configuration file: /usr/local/etc/namedb/named.conf.



This may or may not work depending on how the port maintainer has decided to handle the default configuration file(s) for the port. Some ports place just a .sample configuration file and the user has to copy the sample file to the proper file name and other ports do that automatically on install. There's no good policy on default configuration files yet.


----------



## SirDice (Jul 15, 2015)

Just look at what's running: `pgrep -lf named`. If you see /usr/sbin/named on a FreeBSD 9.x or older, it's the BIND that came with the OS. If it's /usr/local/sbin/named it's one of the BIND ports. If the command doesn't produce output there's no BIND running


----------

