cmedik

Member
Jan 27, 2013
22
0
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

Could you elaborate on what type of modifications do you need to make to the /etc/named.conf file?

Thank you.
 

cmedik

Member
Jan 27, 2013
22
0
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; };
};
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
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.
 

cmedik

Member
Jan 27, 2013
22
0
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
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.
 

cmedik

Member
Jan 27, 2013
22
0
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
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.
 

cmedik

Member
Jan 27, 2013
22
0
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.
 

cPanelPeter

Senior Technical Analyst
Staff member
Sep 23, 2013
586
25
153
cPanel Access Level
Root Administrator
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.
 

cmedik

Member
Jan 27, 2013
22
0
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.