Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to achieve what has basically been asked in this question:

http://superuser.com/questions/403662/bind-dns-settings-on-mac-os-x-lion-errors-in-zone-file

e.g. I need to set up a TLD of .local (or whatever) so that I can bind virtualhosts to it in apache so that other computers on the network (or in my case on virtual machines) are able to connect to the server using specific domain names. So I have have http://moodle19.local/ and http://moodle22.local:8888/ and http://somesite.local:82/ and so on all running on the same instance of apache in mamp. The Apple 'Tims-MacBook-Air.local' address doesn't seem to let me run ports, or different site names for sites that are bound to a particular name and so on.

Reading about how to do this, I came across instructions that suggest I use BIND to set up a local DNS server on my mac (Lion), and I do NOT have a dedicated server. I am trying to follow the instructions which let me know the commands to put in because I'm hopeless at this command line stuff.

http://www.macshadows.com/kb/index.php?title=How_To:_Enable_BIND_-_Mac_OS_X's_Built-in_DNS_Server

I am up to the part that says If both ports are not the same, it's best to change one before starting BIND. I have performed these commands:

bash-3.2# more /etc/rndc.conf | grep '\-port'
    default-port 953;
bash-3.2# more /etc/named.conf | grep 'inet.*\?port'
    inet 127.0.0.1 port 54 allow {any;}
bash-3.2# 

So it would appear to me that i have different ports. I am not sure what I should be changing these to... E.g. I'm guessing named.conf is the authority on this because it existed before I started, whereas rndc.conf did not exist. So it appears to listen on port 54 whereas rndc.conf has port 953 (being some high version of 53, which i vaguely recall to be for DNS)

Assuming I was doing the right thing, I changed rndc.conf to port 54.

I then added org.isc.named to launchctl and tried to execute it using the instructed commands

bash-3.2# launchctl load -w /System/Library/LaunchDaemons/org.isc.named.plist 
bash-3.2# echo "launchctl start org.isc.named" >> /etc/launchd.conf
bash-3.2# /usr/bin/named
bash: /usr/bin/named: No such file or directory

Is this a problem? I don't know what I just did but "named" doesn't appear to be present in /usr/bin on my mac. I don't know how to find it. Performing launchctl start org.isc.named did not produce an error. If I perform ps -x (or -A) then I can see something called /usr/sbin/named -f which I presume is the same thing. Is it just a typo in that doc or because it is for an older OSX version? I executed /usr/sbin/named and now I see it twice in the ps -A list. Again, no idea if this is what I am supposed to see.

Further down the list, when adding a local zone file there's an instruction to add an email address. Copy and paste the following configuration, replacing user.domain.com with your e-mail address (changing the @ to a period as shown). Mine (e.g. my real email address) has a dot (.) in it... Is this going to be a problem - or can I actually use a fake email here at this point? The instructions do not seem to indicate it, and this utility

http://pgl.yoyo.org/as/bind-zone-file-creator.php

wasn't helpful in determining the reason for the email address either. I assumed that the email address is just a token and put in one that isn't real, and left the file as per the example (here), since it covers me for a local tld which is what I want (I'm also happy to have something else such as banana.fish.moocow as suggested here - as long as it's static and it's not an IP address I don't care - yes, my IP is dynamically assigned and no I can't do anything about that).

So I tried to reload the rndc so that it would have my new record. Here's the output of the restart, stop and flush commands, followed by a ping that indicates that it is NOT working.

bash-3.2# rndc reload
WARNING: key file (/private/etc/rndc.key) exists, but using default configuration file (/private/etc/rndc.conf)
server reload successful
bash-3.2# rndc stop
WARNING: key file (/private/etc/rndc.key) exists, but using default configuration file (/private/etc/rndc.conf)
bash-3.2# rndc flush
WARNING: key file (/private/etc/rndc.key) exists, but using default configuration file (/private/etc/rndc.conf)
bash-3.2# rndc reload
WARNING: key file (/private/etc/rndc.key) exists, but using default configuration file (/private/etc/rndc.conf)
server reload successful
bash-3.2# ping webapp.local
ping: cannot resolve webapp.local: Unknown host
bash-3.2# 

Well, I'm clueless as to what to do next... It doesn't work, I don't know how to fix it.

I have read other suggestions such as this one but were unable to follow what they were talking about. "We used product X" does not give me any indication of what I should do. I looked at the http://www.thekelleys.org.uk/dnsmasq/doc.html page but scratched my head at it because it's assuming I know more than I do (e.g. how do I run it if I'm spooked by the command line?), which is how all linux people behave.

It appears to be how Apple behaves too, in the opposite direction. here is a link that tells me that my administrator will know what to do with these fields. I'm the freakin administrator, and no I don't. May as well put an article up that says "Tick the box that makes you even more confused". grumble

ps. Aplogies for the links not being links, aparently I might be a spam bot which knows how to break the unbreakable reCaptcha, wouldn't that be neat.

share|improve this question
2  
TL;DR but try to avoid local. as a top level domain. It will conflict with DNS-SD (Bonjour) which also uses that top level domain. Maybe that's interfering. –  Celada Apr 10 '12 at 1:09
1  
oh well, if you had read it then you would have seen where I linked to the article acknowledging TLD choices and bonjour, so I know the risks there. –  frumbert Apr 10 '12 at 5:12

1 Answer 1

I came here because of your error:

WARNING: key file (/private/etc/rndc.key) exists, but using default configuration file (/private/etc/rndc.conf)

To solve this I did the following:

  1. Create /usr/local/etc/
  2. Move /etc/rndc.key to /usr/local/etc/
  3. Update /etc/rndc.conf and /etc/named.conf to include /usr/local/etc/rndc.key
  4. rndc reload

In commands this looks like:

sudo -s
mkdir -p /usr/local/etc
mv /etc/rndc.key /usr/local/etc
vi /etc/rndc.conf
vi /etc/named.conf
rndc reload

cat /etc/rndc.conf yields:

# Start of rndc.conf
include "/usr/local/etc/rndc.key";

options {
...

cat /etc/named.conf yields:

//
// Include keys file
//
include "/usr/local/etc/rndc.key";
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.