Re: EOF and Zone Files - DNS

This is a discussion on Re: EOF and Zone Files - DNS ; On Thu October 12 2006 17:18, toniintc@gmail.com wrote: > $zone .= $records_mx . $recor);ds_a . $records_cname . "\n"; > $f = fopen($this->path . "/$letter/" . $domain, "w"); > fwrite($f, $zone); > fclose($f); I'm not a real programmer but aren't you ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Re: EOF and Zone Files

  1. Re: EOF and Zone Files

    On Thu October 12 2006 17:18, toniintc@gmail.com wrote:

    > $zone .= $records_mx . $recor);ds_a . $records_cname . "\n";
    > $f = fopen($this->path . "/$letter/" . $domain, "w");
    > fwrite($f, $zone);
    > fclose($f);


    I'm not a real programmer but aren't you missing a '(' somewhere on the $zone
    line seeing how you have a ')' after $recor?


    --

    Regards
    Robert

    Smile... it increases your face value!



  2. Re: EOF and Zone Files

    In article ,
    Robert Spangler wrote:

    > On Thu October 12 2006 17:18, toniintc@gmail.com wrote:
    >
    > > $zone .= $records_mx . $recor);ds_a . $records_cname . "\n";
    > > $f = fopen($this->path . "/$letter/" . $domain, "w");
    > > fwrite($f, $zone);
    > > fclose($f);

    >
    > I'm not a real programmer but aren't you missing a '(' somewhere on the $zone
    > line seeing how you have a ')' after $recor?


    That's almost certainly a cut-and-paste error, and the actual variable
    is $records_a.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***



  3. Re: EOF and Zone Files

    Yes, it was indeed a cut and paste error.

    It turns out that the problem only happens when I reload the zones
    directly from the code with either:

    exec("/usr/local/sbin/rndc reload");

    or

    shell_exec('sudo /usr/local/sbin/rndc reload');

    both of which do not give an error and obviously trigger the reload as
    there are entries in the log file. For some reason if I disable the
    reload in the code and issue the rndc reload from the shell as root, it
    works fine. So, as a permanent fix I simply write a trigger file to
    /var/named from the code, and run a cron script once a minute to check
    for that file. If it's present I delete it and do an rndc reload. Now
    everything works as it should. This is probably better anyway,
    especially given I have co-workers that could add and remove zones and
    rr's in rapid fire fashion - now it will only reload once per minute no
    matter what, versus every time something is changed.

    Thanks for the help!

    Toni



+ Reply to Thread