sending mail on lan... Solved!

Jerry LeVan jerry.levan at eku.edu
Mon Aug 6 09:22:27 PDT 2007


I am happy to report that "skynet" became self aware today
and is name serving for my small net.

[mbp:~]$ cat /var/named/skynet.zone
$TTL    86400
$ORIGIN skynet.
@                       1D IN SOA       @ root (
                                         42              ; serial (d.  
adams)
                                         3H              ; refresh
                                         15M             ; retry
                                         1W              ; expiry
                                         1D )            ; minimum

                         1D IN NS        localhost
                         1D IN NS        server
localhost               1D IN A         127.0.0.1
server                  IN A            192.168.1.90
mbp                     IN A            192.168.1.80
linuxbox                IN A            192.168.1.70
jerrypc                 IN A            192.168.1.60
macjerry                IN A            192.168.1.10
laser                   IN A            192.168.1.40
router                  IN A            192.168.1.1

moreover:
[mbp:~]$ mail -s"From mbp to server" jerry at server
Mail from mbp to server machine
.
EOT

gives on mbp
Aug  6 11:36:33 mbp postfix/pickup[3338]: C6E4014FE2F: uid=501  
from=<jerry>
Aug  6 11:36:33 mbp postfix/cleanup[3339]: C6E4014FE2F: message- 
id=<20070806153633.C6E4014FE2F at mbp.skynet>
Aug  6 11:36:33 mbp postfix/qmgr[2418]: C6E4014FE2F:  
from=<jerry at mbp.skynet>, size=333, nrcpt=1 (queue active)
Aug  6 11:36:35 mbp postfix/smtp[3341]: C6E4014FE2F:  
to=<jerry at server.skynet>, orig_to=<jerry at server>, relay=server.skynet 
[192.168.1.90], delay=2, status=sent (250 Ok: queued as 0FA6EC989C)
Aug  6 11:36:35 mbp postfix/qmgr[2418]: C6E4014FE2F: removed

and on the target server
Aug  6 11:37:23 server postfix/qmgr[294]: 0FA6EC989C:  
from=<jerry at mbp.skynet>, size=514, nrcpt=1 (queue active)
Aug  6 11:37:23 server postfix/local[295]: 0FA6EC989C:  
to=<jerry at server.skynet>, relay=local, delay=2, status=sent  
(delivered to mailbox)
Aug  6 11:37:23 server postfix/qmgr[294]: 0FA6EC989C: removed

The /etc/named.conf needs a small tweak or two.
   The main change is to add the forwarders option
   and include the name servers provided by your isp
   in the options.

   in the controls directive the port number is incorrect
   rndc uses 953.

   running rndc-confgen will generate a key that can be
   used for rndc.

I recommend doing a "tail -f /var/log/system.log" and
manually starting named to make sure that there are
no syntax errors in the configurations files and everything
works as expected.

Once stuff is working I was able to enable the nameserver
at boot time by using "Lingon" ( a cool free app that
allows one to manipulate the launcher startup items).

One also need to tweek the main.cf of postfix to recognize
the domain (skynet in this case) an allow users on the
domain skynet to send mail to other machines on skynet.

Another nice factoid is that I only takes a couple of
clicks in the network setup preferences to go back
to using the isp in case the server becomes unavailable.


Here is my copy of /etc/named.conf:

include "/etc/rndc.key";

// Declares control channels to be used by the rndc utility.
//
// It is recommended that 127.0.0.1 be the only address used.
// This also allows non-privileged users on the local host to manage
// your name server.

//
// Default controls
//
controls {
         inet 127.0.0.1 port 953 allow {any;}
         keys { "rndc-key"; };
};

options {
         directory "/var/named";
         forwarders { 68.168.160.2; } ;
         /*
          * If there is a firewall between you and nameservers you want
          * to talk to, you might need to uncomment the query-source
          * directive below.  Previous versions of BIND always asked
          * questions using port 53, but BIND 8.1 uses an unprivileged
          * port by default.
          */
         // query-source address * port 53;
};
//
// a caching only nameserver config
//
zone "." IN {
         type hint;
         file "named.ca";
};

zone "skynet" IN {
         type master;
         file "skynet.zone";
         allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
         type master;
         file "named.local";
         allow-update { none; };
};

zone "1.168.192.in-addr.arpa" IN {
         type master ;
         file "db.192.168.1";
         allow-update { none; };
};
logging {
         category default {
                 _default_log;
         };

         channel _default_log  {
                 file "/Library/Logs/named.log";
                 severity info;
                 print-time yes;
         };
};



More information about the MacOSX-admin mailing list