Upstart job for BIND9

2012-11-29 Thread Alexander Gurvitz
Hello.

I'm trying to run a bind9 from an upstart job instead of an init.d script.
I'm a bit confused if I should expect fork or expect daemon. It seems
to work with expect fork, though somehow I don't feel convinced.

(Upstart must know how the daemon forks - if it forks once,
expect fork should be specified, and if a daemon forks twice,
it should be expect daemon. Then upstart will wait for that forkings and
will monitor the final PID).

Thanks in advance,
Alexander Gurvitz,
net-me.net

P.S My /etc/init/bind.conf:

start on runlevel [2345]
stop on runlevel [!2345]

pre-start script
# dirs under /var/run can go away on reboots.
mkdir -p /var/run/named
chmod 775 /var/run/named
chown root:bind /var/run/named /dev/null 21 || true
end script

exec /usr/sbin/named -u bind

pre-stop exec rndc stop -p

post-stop exec logger -p user.warning -t upstart-bind bind stopped

expect fork
respawn
respawn limit 3 10
kill timeout 30
console none
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

OT - Dns test Q/A

2012-11-29 Thread Chiesa Stefano
Hello all.
I created an application to delegate zone management to collegues that
are used to ask changes to that zones.

I would set up a small zone administration test to verify a minimal
dns knowledge (right use of main RR such A-CNAME-MX.)
Can you suggest me a document from which I can extract few questions?

Sorry for the OT and thanks in advance.

Stefano Chiesa.


Stefano Chiesa
Wolters Kluwer Italia
Network Specialist
Strada 1, Palazzo F6
20090 Milanofiori Assago (Mi) - Italia
Phone +39 0282476279 (20279 Voip)
Fax +39 0282476815


 
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: Upstart job for BIND9

2012-11-29 Thread Alexander Gurvitz
Carsten,

The script in my original question (it's in the P.S. at the bottom of my
first mail) seem to work for me. It does not cover all the extra logic of
the ubuntu default init.d/bind9, but I personally don't need that (ubuntu
script may update resolv.conf, and also checks if there's a network
available).

But now I realised that it's all much simpler. named -f runs bind in the
foreground (does not daemonise) and that's just what upstart needs. Here's
my new upstart job file, place it to /etc/init/bind.conf (I can't decide
which one is better: bind.conf, bind9.conf or named.conf :)

#UPSTART JOB FOR BIND9
start on runlevel [2345]
stop on runlevel [!2345]

pre-start script
# dirs under /var/run can go away on reboots.
mkdir -p /var/run/named
 chmod 775 /var/run/named
chown root:bind /var/run/named /dev/null 21 || true
end script

#Add bind command-line options below
exec /usr/sbin/named -f -u bind

pre-stop exec rndc stop

post-stop exec logger -p user.warning -t upstart-bind bind stopped

respawn
respawn limit 3 10
kill timeout 30
console none
#END

It will run bind on runlevels 2345, stop bind on other runlevels, but the
most important - respawn it once it stops with one it's famous assertion
failures :). It also logs a warning to syslog when bind closes (I use
something like that to send me an email).

If someone wants to use the job, here's some instructions: 1. don't forget
to disable the init.d script, or you may end up with two conflicting nameds
- the easiest way is sudo chmod -x /etc/init.d/bind9 . 2. As with any
upstart job, to stop bind you now do stop bind, to start - start bind,
and there's also restart bind. If you have your fancy stuff in
/etc/defaults/bind9, just add at to the end of the exec line.

It seems to work for me, but I can't say it's really tested. Comments and
improvements are greatly appreciated.

Alex,
net-me.net
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: Upstart job for BIND9

2012-11-29 Thread Carsten Strotmann

Hello Alexander,

Alexander Gurvitz a...@net-me.net writes:

 Carsten,

 The script in my original question (it's in the P.S. at the bottom of
 my first mail) seem to work for me. 

Ahh, thanks, my Emacs was hiding that :)


 (I can't decide which one is better: bind.conf, bind9.conf or
 named.conf :)

I would vote for bind9-upstart.conf.

named.conf is already the default name for the BIND 9 configuration

bind.conf is not specific once BIND 10 will be used on the same
machine.


-- Carsten
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: Upstart job for BIND9

2012-11-29 Thread Matus UHLAR - fantomas

On 29.11.12 14:03, Alexander Gurvitz wrote:

It will run bind on runlevels 2345, stop bind on other runlevels, but the
most important - respawn it once it stops with one it's famous assertion
failures :).


famous assertion failures? What system do you run the BIND on? Shouldn't you
better upgrade to version that has no famous assertion failures?


--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Linux IS user friendly, it's just selective who its friends are...
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re:

2012-11-29 Thread Chuck Swiger
Hi--

On Nov 29, 2012, at 3:00 PM, Jose Manuel Delgado G. wrote:
 I have the following problem in resolving my DNS using Bind 9, sends me an 
 error connection time out, no servers Could be reached. that way I can avoid 
 giving these errors and how I can reduce the time of the response?
 
 this example with my server and public google dns server.
 
 # dig @8.8.8.8 videolinedvd.com
[ ... ]

You've got two nameservers for the domain per WHOIS as:

   Domain servers in listed order:
  NS1.VIDEOLINEDVD.COM
  NS2.VIDEOLINEDVD.COM

...but they don't have A records setup.  Your nameservers must have A records:

% dig NS1.VIDEOLINEDVD.COM @8.8.8.8
[ ... ]
;; -HEADER- opcode: QUERY, status: SERVFAIL, id: 36700
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;NS1.VIDEOLINEDVD.COM.  IN  A

See http://www.dnsvalidation.com/reports/50b7e96a7d79ee480a04

Regards,
-- 
-Chuck

___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re:

2012-11-29 Thread Jose Manuel Delgado G.
thanks chuck,

about the other question, as to reduce the response time of my server when
the domain does not exist?

Thanks a lot!
JM


2012/11/29 Chuck Swiger cswi...@mac.com

 Hi--

 On Nov 29, 2012, at 3:00 PM, Jose Manuel Delgado G. wrote:
  I have the following problem in resolving my DNS using Bind 9, sends me
 an error connection time out, no servers Could be reached. that way I can
 avoid giving these errors and how I can reduce the time of the response?
 
  this example with my server and public google dns server.
 
  # dig @8.8.8.8 videolinedvd.com
 [ ... ]

 You've got two nameservers for the domain per WHOIS as:

Domain servers in listed order:
   NS1.VIDEOLINEDVD.COM
   NS2.VIDEOLINEDVD.COM

 ...but they don't have A records setup.  Your nameservers must have A
 records:

 % dig NS1.VIDEOLINEDVD.COM @8.8.8.8
 [ ... ]
 ;; -HEADER- opcode: QUERY, status: SERVFAIL, id: 36700
 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

 ;; QUESTION SECTION:
 ;NS1.VIDEOLINEDVD.COM.  IN  A

 See http://www.dnsvalidation.com/reports/50b7e96a7d79ee480a04

 Regards,
 --
 -Chuck


___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re:

2012-11-29 Thread Chuck Swiger
On Nov 29, 2012, at 3:34 PM, Jose Manuel Delgado G. wrote:
 about the other question, as to reduce the response time of my server when 
 the domain does not exist?

BIND implements negative caching of NXDOMAIN responses:

% dig www.does.not.exist. @localhost
[ ... ]
;; -HEADER- opcode: QUERY, status: NXDOMAIN, id: 4942
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;www.does.not.exist.IN  A

;; AUTHORITY SECTION:
.   10800   IN  SOA a.root-servers.net. 
nstld.verisign-grs.com. 2012112901 1800 900 604800 86400

;; Query time: 360 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Nov 29 18:35:52 2012
;; MSG SIZE  rcvd: 111

% dig www.does.not.exist. @localhost
[ ... ]
;; -HEADER- opcode: QUERY, status: NXDOMAIN, id: 55697
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;www.does.not.exist.IN  A

;; AUTHORITY SECTION:
.   10789   IN  SOA a.root-servers.net. 
nstld.verisign-grs.com. 2012112901 1800 900 604800 86400

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Nov 29 18:36:03 2012
;; MSG SIZE  rcvd: 111

Regards,
-- 
-Chuck

___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: Upstart job for BIND9

2012-11-29 Thread Noel Butler
On Thu, 2012-11-29 at 13:35 +0100, Carsten Strotmann wrote:

 Hello Alexander,
 
 Alexander Gurvitz a...@net-me.net writes:
 
  Carsten,
 
  The script in my original question (it's in the P.S. at the bottom of
  my first mail) seem to work for me. 
 
 Ahh, thanks, my Emacs was hiding that :)
 
 
  (I can't decide which one is better: bind.conf, bind9.conf or
  named.conf :)
 
 I would vote for bind9-upstart.conf.
 
 named.conf is already the default name for the BIND 9 configuration
 


You would probably get better help for ubuntu-specific things on a
ubuntu mailing list.




signature.asc
Description: This is a digitally signed message part
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users