The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Where can i find the zone file template?

Discussion in 'General Discussion' started by chrisbond, May 28, 2003.

  1. chrisbond

    chrisbond Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hereford, United Kingdom
    I want to add a default secondary mx record - where can i find the default zone file template - cant find it anywhere!

    cPanel.net Support Ticket Number:
     
  2. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    thier isnt a template, /scripts/adddns is the file that adds zones.

    Also the script uses /etc/wwwacct.conf and pulls 2 nameservers i beleive. If you log into your WHM and under setup change the secondary nameserver in their to whatever you want it set to it will auto add that ns to the zones.


    As you can see by this code from adddns....

    open(CONF,"/etc/wwwacct.conf") || die "/etc/wwwacct.conf not found\n";
    while(<CONF>) {
    $_ =~ s/\n//g;
    if ($_ !~ /^;/) {
    if(/^NS (\S+)$/) {
    $nameserver = $1;
    }
    if(/^NS2 (\S+)$/) {
    $nameserver2 = $1;
    }
    if (/^CONTACTEMAIL/) {
    (undef,$contactemail) = split(/ /, $_);
    }
    }
    }
    close(CONF);

    cPanel.net Support Ticket Number:
     
  3. chrisbond

    chrisbond Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hereford, United Kingdom
    Very werid later on the /scripts/adddns file i added:

    $ndomain. IN MX 0 $ndomain.
    $ndomain. IN MX 15 mxbackup.myserver.net.

    Then when i added a new domain it didnt take effect.

    cPanel.net Support Ticket Number:
     
  4. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    account creation probably doesnt use this... what if you create a zone manually under dns fucntions? also remember upcp and updatenow will over write that file with the correct version from cpanel once they are run. All scripts in /scripts are sync'd with cpanel's versions.

    cPanel.net Support Ticket Number:
     
  5. chrisbond

    chrisbond Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hereford, United Kingdom
    Yup just noticed that myself - seems a shame to have to manually edit the zone file after would be cool if there was an extra variable.

    There is a file /etc/secondarymx but theres no documentation for it gonna add a line to it see what it does.

    cPanel.net Support Ticket Number:
     
  6. chrisbond

    chrisbond Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hereford, United Kingdom
    Nope didnt do anything

    cPanel.net Support Ticket Number:
     
  7. chrisbond

    chrisbond Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hereford, United Kingdom
    Theres a good reason why that file didnt work its part of exim:

    # If you are an MX backup or gateway of some kind for some domains, you must
    # set relay_domains to match those domains. This will allow any host to
    # relay through your host to those domains.
    #
    # See the section of the manual entitled "Control of relaying" for more
    # information.
    relay_domains = lsearch;/etc/localdomains : lsearch;/etc/secondarymx

    Aye well, anybody wrote any scripts to add secondary dns on a crontab basis?

    cPanel.net Support Ticket Number:
     
  8. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    /etc/secondarymx is for domains using your server as a secondary mx server... you'd put one domain per line.


    you could write a cron script that ran thru checking and adding the secondary mx.

    sumit a feature request to cpanel and ask them to add a field to teh setup screen which allows you to set a secondary MX and the weight so that it's added by default... i'm sure they'd do this.

    cPanel.net Support Ticket Number:
     
  9. chrisbond

    chrisbond Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hereford, United Kingdom
    Found it in /scripts/wwwacct that does the job nicely its hidden in there - just need to keep an eye out when i run updatenow or upcp to make sure it doesnt get overwritten.

    cPanel.net Support Ticket Number:
     
  10. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Unless you chattr it, it will be overwritten every night.

    cPanel.net Support Ticket Number:
     
  11. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    dgbaker, true, but i'm sure their are others out their who would like to see a feature like this, i know i would if i ran dns on my servers.

    cPanel.net Support Ticket Number:
     
  12. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Not denying that, there are a lot of things with cpanel that are not configurable enough when it comes to running a server. They could very easily create an area in WHM to allow you to modify the /scripts files and not have the changes overwritten.

    For example why not put all of the DNS functions in one script, then call that script as required. As it is now making DNS changes to wwwacct only helps with new accounts, it does not help with parking domains etc... Also if at any point an account is suspened and then unsuspended, a lot of the customizations are lost.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page