# FreeBSD DNS Server



## drlego (Feb 10, 2012)

Hi all,

I am new to the forum and pretty new to FreeBSD. I have an old DNS server running on FreeBSD that a friend set up years ago. I basically go in, add a line in the named.conf file, and then create a zone file. I then type *ndc restart* and I am done.

Well, I need to set up a new FreeBSD DNS server. I already installed FreeBsd FreeBSD 8.2. Is there a step by step tutorial how to set this up?  I would be willing to pay someone to walk me through it. if anyone can help, let me know.

[ email removed, use PM for communication! -- Mod ]

Really appreciate it!
Peter


----------



## SirDice (Feb 10, 2012)

Nothing much has changed. Just copy named.conf and the zone files. But it might be better to review the file on the new machine and only add the things you need from the old one.

Should be a piece of cake really.


----------



## drlego (Feb 10, 2012)

So everything is installed automatically?  There is no other configuration?
ndc is running?


----------



## kpa (Feb 10, 2012)

The admin tool for restarting the server is now called rndc(8) but the safest way to restart the server is to use the supplied /etc/rc.d/named script.


----------



## SirDice (Feb 10, 2012)

drlego said:
			
		

> So everything is installed automatically?


The base OS already contains a version of BIND, so there really isn't a need to install anything else. It's likely the old server also used the standard BIND that came with the OS.



> There is no other configuration?


Besides the obvious hostname and IP address for the machine, no.

I'm going to assume there's no ports tree on the system (or an up to date one), have a look what else is installed by looking in /var/db/pkg/. If you do an ls it should show a list of directories with the names of the ports/packages that have been installed.


----------



## dave (Feb 11, 2012)

Once your new FreeBSD machine is up and running, you need to do a few things...

- Copy the zone files from the old machine to the new machine, same location.  Create the directory if needed.

- Copy the /etc/namedb/named.conf file from old machine to new machine, same location.  (Maybe make a backup of the original conf file on the new machine for reference, before overwriting it.  You might want to read that file to learn something from the comments.)

- Enable the named service to start at system boot in /etc/rc.conf:

```
named_enable="YES"
```

- Start the named service:

```
# service named start
```

You can PM me if you have trouble, I am willing to help out.


----------



## throAU (Feb 13, 2012)

If your DNS server is a few years old, I'd review the inbuilt named.conf and copy across your zone files/zone file definitions.

However, again - if your DNS is several years old, I'd also review the current best practice for DNS zones, as things have changed in the past decade or so.

This is an excellent reference for DNS, and this is an excellent diagnostics page for verifying that your zones are configured properly and showing the info that you intend to publish to the internet.


----------



## synack (Feb 17, 2012)

Hi everyone,

I am also having problems setting up a FreeBSD DNS server. This thread already existed so I though that I would post here instead of creating a new one. I am setting up a LAN at home with a dozen or so computers to experiment with. I am using BIND98 from the ports because I was following instructions in the Book 'Building A Server with FreeBSD 7' by Bryan J Hong even though I am using FreeBSD 9 RELEASE. I've followed all the instructions but my problem is the LAN Intranet I am building is not connected to the Internet or any other networks. When I test with *dig* it times out because it is trying to reach another DNS server (I think)


```
; <<>> DiG 9.8.1-p1 <<>> myhomedomain
;; global options: +cmd
;; connection timed out; no other servers could be reached
```

I do not know a lot about DNS, hence the test LAN but do I need to set up the DNS server as an Authoritative server or something along those lines?

Any help would be great.

thanks,

synack.


----------



## dave (Feb 17, 2012)

Synack,

If you want to query your new DNS server with [CMD=""]dig[/CMD], then specify your new DNS server like so:


```
dig @serverip myhomedomain
```

Replace *serverip* with the IP address of your new DNS server.  If you don't tell [CMD=""]dig[/CMD] which server to ask, then it will just use the DNS servers configured on the machine you are testing from, which are probably configured for Internet access and don't know anything about your internal domain.

To sum up, read the man page for dig:


```
man dig
```

Also, as a tip, don't use a book from 7 to work with 9, it's going to cause problems.  You need to seek recent info.  Why not try the online handbook?  Besides, FreeBSD comes with Bind built in now, so no need for any ports.


----------



## dave (Feb 17, 2012)

synack said:
			
		

> "If you are new to UNIX, you may be used to clicking something and seeing either an "OK" message, an error, nothing, or (all too often) a pretty blue screen with nifty high-tech letters' explaining exactly where the system crashed" - Michael Lucas



That sounds a lot more like Windows to me.  :stud


----------



## synack (Feb 17, 2012)

dave said:
			
		

> That sounds alot more like Windows to me.  :stud



Hi Dave,

Thank you for your help. The quote is referring to windows users. Kind of like under windows you may be used to all these things, but under UNIX the problems disappear. 

synack


----------

