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.

Edit named.conf

Discussion in 'General Discussion' started by cmedik, Jan 9, 2014.

  1. cmedik

    cmedik Member

    Joined:
    Jan 27, 2013
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Yes I am new to all this and been reading a lot. But I need to add some files to my named.conf through bind. But I have read many ways of doing it and always the issue I see is do it wrong and your screwed. So if someone could be so kind is to give me the proper steps through SSH or WHM to do this that would be great. On how to edit than save it and if I screw it up on how to go back in and delete those changes I have made. Thanks

    John
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. cmedik

    cmedik Member

    Joined:
    Jan 27, 2013
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    A company I want to use as a spam checker requires me to add a forwarding in bind here is an example they sent me in an email.
    I use centOS 6.5. I changed the info of who and where but you can get the jist.

    For reference, here is how this forwarding is done in BIND:

    zone "xxx.xxxxxx.com" in {
    type forward;
    forward only;
    forwarders {xxx.xxx.xxx.xxx; };
    };
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can add custom entries to the /etc/named.conf file by editing it directly:

    Code:
    vi /etc/named.conf
    Remember to restart the Named service after making any changes. Note that you should refrain from running /scripts/rebuilddnsconfig if you do not want the custom entry overwritten.

    Thank you.
     
  5. cmedik

    cmedik Member

    Joined:
    Jan 27, 2013
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    How do I restart it please and thanks for all the help.

    - - - Updated - - -

    One last thing when I am done making the changes have do I exit it or save it.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can run the following command to restart Named:

    Code:
    /etc/init.d/named restart
    As for editing a file via "vi", you can find several tutorials by searching the term "how to use vi" on a search engine. This will produce several useful results on all of the commands available to you.

    Thank you.
     
  7. cmedik

    cmedik Member

    Joined:
    Jan 27, 2013
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    ok one last thing learning a lot thank you. But when I restart named it comes up with an error /etc/named.conf:391: '}' expected near end of file. What would cause error.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    That indicates there is a syntax error on line 391 of the /etc/named.conf file. It's likely the custom modification was not entered correctly, or is not a valid entry.

    Thank you.
     
  9. cmedik

    cmedik Member

    Joined:
    Jan 27, 2013
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    I thank you again for help this should be last thing. Where exactly do I put the forward at. I tired putting it at very bottom and that where I think I am screwing up. Cause this is default and never been edited before. I have downloaded it and got it open in Word to see it better.
     
  10. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Since it appears to be related to a zone, does the zone already exist? In other words have you already added that domain via WHM? If so, you should not add the data block. you should simply find that zone (that you wish to add the forward options to) and add the forward option accordingly.

    Hope that helps.
     
  11. cmedik

    cmedik Member

    Joined:
    Jan 27, 2013
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    No zone does not exist. This is just what the spam filter company wanted me to add to my Bind to do queries done to them.
     
Loading...

Share This Page