This is a little howto on i can install a named on a macosx.
There simple steps:
1) Compile the bind
I've placed the chroot environment in /opt/named, so i've choose to install there the named.
I used the configure script to put the destination:
~/bind-9.3.1 root# ./configure --prefix=/opt/named
After you need only to compile with normal command "make && make install"
2) Create the environment
I've created a simple directory tree into /opt/named
--dev
--etc
--var
-+--log
-+--run
The other directory are created by the installation script of named
Into /opt/named/dev i've created these device: null, random, zero. I don't know the major and the minor for mknod, so i've seen into /dev/ the number with 'ls -la /dev/null', and so on.
Copy the file /etc/localtime into the etc directory of your chroot
3) Configure the bind
You can use your normal named.conf, but i need to add some lines, else there are some problems with the path into the chroot:
options {
pid-file "/var/run/named.pid";
named-xfer "/bin/named-xfer";
statistics-file "/var/run/named.stats";
dump-file "/var/run/named.db";
};The MacOsX syslogd don't support the -a flag for additional "/dev/log", i've configured the named for using the log files. There is some configuration that i've found in a gentoo howto, they will be really usefull:
logging {
channel default_file { file "/var/log/default.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel general_file { file "/var/log/general.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel database_file { file "/var/log/database.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel security_file { file "/var/log/security.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel config_file { file "/var/log/config.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel resolver_file { file "/var/log/resolver.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel xfer-in_file { file "/var/log/xfer-in.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel xfer-out_file { file "/var/log/xfer-out.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel notify_file { file "/var/log/notify.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel client_file { file "/var/log/client.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel unmatched_file { file "/var/log/unmatched.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel queries_file { file "/var/log/queries.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel network_file { file "/var/log/network.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel update_file { file "/var/log/update.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel dispatch_file { file "/var/log/dispatch.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel dnssec_file { file "/var/log/dnssec.log" versions 3 size 5m; severity dynamic; print-time yes; };
channel lame-servers_file { file "/var/log/lame-servers.log" versions 3 size 5m; severity dynamic; print-time yes; };
category default { default_file; };
category general { general_file; };
category database { database_file; };
category security { security_file; };
category config { config_file; };
category resolver { resolver_file; };
category xfer-in { xfer-in_file; };
category xfer-out { xfer-out_file; };
category notify { notify_file; };
category client { client_file; };
category unmatched { unmatched_file; };
category queries { queries_file; };
category network { network_file; };
category update { update_file; };
category dispatch { dispatch_file; };
category dnssec { dnssec_file; };
category lame-servers { lame-servers_file; }
;};4) Starting Up
The macosx has the facility daemon to application named launchd. I've put the file org.sfrajone.named.plist into /Library/LaunchDaemons which contain system wide daemon provided by the administrator, not the system one.
Here the file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.sfrajone.named</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/opt/named/sbin/named</string>
<string>-f</string>
<string>-t</string>
<string>/opt/named</string>
<string>-u</string>
<string>named</string>
<string>-c</string>
<string>/etc/named.conf</string>
</array>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
Now we need to remove from the startup the system named:
root# launchctl unload -w /System/Library/LaunchDaemons/org.isc.named.plist
Then we need to put the our named:
root# launchctl load -w /Library/LaunchDaemons/org.sfrajone.named.plist
And startit with:
root# launchctl start org.sfrajone.named
Now the named has been started, at the next reboot will start automatically.