# where is the "listen-on { 192.249.249/24; }; };" line in named.conf file



## baronobeefdip (Jun 20, 2011)

We are setting up a DNS server using BIND that was pre-installed when we installed FreeBSD on our box. We have been getting confused and nowhere no matter how many times we go over the Handbook we just can't find any answers to our questions.

When we use Linux, the line is typed in as:

```
listen-on port 53 { 127.0.0.1; };
```

But I suspect that it is different in BSD. The line is already present in the configuration file after we install BIND and we can go in and change it. We can't find it in BSD so I am assuming that you have to add it in manually. 

We usually put it in as:

```
listen-on port 53 { any; };
```

How do we set it up the way I have stated? If we need to manually add it to the configuration file then I guess that would make sense. Where do we add it?


----------



## wblock@ (Jun 20, 2011)

/etc/namedb/named.conf line 21.


----------



## baronobeefdip (Jun 21, 2011)

If it isn't there than does that mean we have to add it in manually?


----------



## wblock@ (Jun 21, 2011)

If the line isn't there, it's been deleted by someone.  The original source file is at /usr/src/etc/namedb/named.conf.


----------



## baronobeefdip (Jun 21, 2011)

So under the options section is where I should add the line if it were to disappear?


----------



## wblock@ (Jun 21, 2011)

Yes, although if it disappeared without your knowledge there's cause for concern.  If you don't have the source installed, it can be seen online.


----------



## baronobeefdip (Jun 21, 2011)

Okay then but now I can't find the code below. 

```
allow-query { localhost; };
```
Is this the same case, can I add it to the configuration file under options manually like the last option line I was talking about?I have absolutely no idea how these options are disappearing but the release that I was previously working with was version 8.1, I installed 8.2 and I found the last option line, but this next option line is nowhere to be found in this 8.2 installation.


----------



## wblock@ (Jun 21, 2011)

named.conf(5) covers all the options.


----------



## kpa (Jun 21, 2011)

There is absolutely no difference in BIND whether you're on Linux or BSD (some minor path differences admitted). You should be able to follow the FreeBSD handbook and the BIND reference at http://www.bind9.net/manuals almost to the letter to get your server going.


----------



## baronobeefdip (Jun 24, 2011)

Got it.
And as for the

```
allow-query
```
line. I can just add it in there manually under the 
"options" section.

I keep getting told that BIND varies based on Operating System. The Directory structure is different. But the configuration files are the same? The fact that I'm being told that BIND varies is confusing me.


----------



## baronobeefdip (Jun 25, 2011)

I have another problem here.
I noticed that in the first step in setting up bind requires running this command.

```
#cd /etc/namedb
#sh make-localhost
```
But whenever I do it I keep getting the same error message.

```
make-localhost: Can't open make-localhost: No such file or directory
```
What's causing this? I would like to know because it's really frustrating.


----------



## wblock@ (Jun 25, 2011)

It sounds like you're following an old, obsolete guide.  Go to the Handbook first.


----------



## baronobeefdip (Jun 25, 2011)

Okay but before I go into further research,  want to know what version of BIND the 8.2 release of FreeBSD comes with before I get the wrong book. is it 9 or is it 10?


----------



## wblock@ (Jun 25, 2011)

named(8) shows.


----------



## baronobeefdip (Jun 26, 2011)

wblock said:
			
		

> Yes, although if it disappeared without your knowledge there's cause for concern.  If you don't have the source installed, it can be seen online.



What do you mean if I don't have the source installed? Shouldn't everything be pre-installed after the OS is installed on the box? Just wondering if we need to fetch and install a port or package of some sort.


----------



## wblock@ (Jun 26, 2011)

baronobeefdip said:
			
		

> What do you mean if I don't have the source installed? shouldn't everything be pre-installed after the OS is installed on the box? Just wondering if we need to fetch and install a port or package of some sort.



Some of the choices in the installer, like "minimal install", don't install the system source.  And the system source includes the default named.conf.


----------



## baronobeefdip (Jun 26, 2011)

We chose to install everything in the installer.

But I just want to bring one thing up. We are experimenting with the OS in a VM Ware virtual machine. Would you suggest using a real machine or does it not matter weather or not if we use a virtual or real machine?


----------



## baronobeefdip (Jul 5, 2011)

This just in. I was told that in order for the host to detect and retrieve information from the DNS server was only if it was in the resolv.conf file. And for it to be done automatically DHCP has to be involved. But I lost track whether the DHCP should be running on the server, the hosts or both. All of the host boxes are set to static IP addresses and we want them to stay that way because we don't want to have anything to do with DHCP. Sure you can get the box to retrieve data from the server if you manually enter the IP address in the resolv.conf file but how is it done automatically after the host requests the domain name from the IP address given? Is that the reverse lookup zone's job?


----------



## wblock@ (Jul 5, 2011)

There's a lot of stuff in that post, but none of it has much to do with the subject line of this thread.  It would be best to start a new thread with an appropriate title describing what you want to accomplish.


----------



## baronobeefdip (Jul 5, 2011)

wblock said:
			
		

> There's a lot of stuff in that post, but none of it has much to do with the subject line of this thread.  It would be best to start a new thread with an appropriate title describing what you want to accomplish.



Alright.


----------

