| 1 | Configuring SWATCH |
|---|
| 2 | |
|---|
| 3 | On MASTER |
|---|
| 4 | |
|---|
| 5 | 1. Create the configuration file for swatch: |
|---|
| 6 | |
|---|
| 7 | - Edit /usr/local/etc/swatch.conf -- use TAB and not SPACE |
|---|
| 8 | for the lines below "watchfor"! |
|---|
| 9 | |
|---|
| 10 | - - - - - - - - - - - - - - cut below - - - - - - - - - - - - - |
|---|
| 11 | |
|---|
| 12 | watchfor /client ([0-9A-F.:]+)\D\d+: transfer of '(.*)\/IN': .XFR/ |
|---|
| 13 | mail=adm,subject=Zone AXFR |
|---|
| 14 | threshold type=limit,count=1,seconds=600 |
|---|
| 15 | |
|---|
| 16 | - - - - - - - - - - - - - - cut above - - - - - - - - - - - - - |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | 2. Enable the mail server |
|---|
| 20 | |
|---|
| 21 | - Add to /etc/rc.conf |
|---|
| 22 | |
|---|
| 23 | postfix_enable="YES" |
|---|
| 24 | |
|---|
| 25 | # newaliases |
|---|
| 26 | # /usr/local/etc/rc.d/postfix start |
|---|
| 27 | |
|---|
| 28 | 3. Try sending mail to yourself |
|---|
| 29 | |
|---|
| 30 | $ echo hello | mail adm@master.grpX.ws.nsrc.org |
|---|
| 31 | |
|---|
| 32 | See if the mail has arrived: |
|---|
| 33 | |
|---|
| 34 | $ mutt -f /var/mail/adm |
|---|
| 35 | |
|---|
| 36 | 4. Start swatch: |
|---|
| 37 | |
|---|
| 38 | # swatch -c /usr/local/etc/swatch.conf --tail-file=/etc/namedb/log/transfers --daemon |
|---|
| 39 | |
|---|
| 40 | # ps axuww | grep swatch |
|---|
| 41 | |
|---|
| 42 | You should see a line like the following: |
|---|
| 43 | |
|---|
| 44 | root 58811 0.0 0.0 11500 2124 5 RJ 11:41AM 0:00.02 /usr/local/bin/perl /usr/local/bin/swatch -c /usr/local/etc/swatch.conf --tail-file=/etc/namedb/log/transfers --daemon |
|---|
| 45 | |
|---|
| 46 | 7. Ask another group to perform a zone transfer of your zone: |
|---|
| 47 | |
|---|
| 48 | From their machine: |
|---|
| 49 | |
|---|
| 50 | # dig @master.grpX.ws.nsrc.org YOURTLD axfr (where X is YOUR group) |
|---|
| 51 | |
|---|
| 52 | Q: do they get a copy of your zone ? |
|---|
| 53 | Q: do you get an email about it ? |
|---|
| 54 | |
|---|
| 55 | 8. Check that mails are coming in: |
|---|
| 56 | |
|---|
| 57 | # mutt -f /var/mail/adm |
|---|
| 58 | |
|---|
| 59 | Note the information contained in the message. |
|---|
| 60 | |
|---|