How do I remove %rpemail% SOA from zone template?

karom43

Member
Mar 3, 2020
9
0
1
AU
cPanel Access Level
Root Administrator
Hi all

I would like to have the main server contact to be my primary contact to receive alerts but not have it appear in the public SOA records.

So in the Zone template editor, how can I remove the %rpemail% variable? If I delete it, the template file throws an error -

1585631822596.png

Any suggestions or alternatives please?

Cheers
K
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston

PeteS

Well-Known Member
Jun 8, 2017
380
85
78
Oregon
cPanel Access Level
Root Administrator
I don't believe you can, that information is pulled directly from what's input here: Basic WebHost Manager Setup | cPanel & WHM Documentation
I'm having the same issue/question...

1- I was going to replace %rpemail% with a hard-coded value (hostmaster.mydomain.com), but will that be allowed in the WHM template editor? If not, can I hard-code it in a file, and will that cause issues and/or be overwritten at some point?

2- I would like control of these vars, especially %ttl%, %nsttl%, and %rpemail%. What can you tell me about that?

3- Why does cPanel use the [email protected] for the RNAME instead of the recommended user.domain.tld format? And why use the server contact instead of hostmaster.example.com (of course that would require it be valid, or sent to root if [email protected] isn't valid)? RFC 2142: Mailbox Names for Common Services, Roles and Functions
 

quietFinn

Well-Known Member
Feb 4, 2006
1,840
426
438
Finland
cPanel Access Level
Root Administrator
1- I was going to replace %rpemail% with a hard-coded value (hostmaster.mydomain.com), but will that be allowed in the WHM template editor? If not, can I hard-code it in a file, and will that cause issues and/or be overwritten at some point?
Yes you can replace that with a hard-coded value.
 
  • Like
Reactions: PeteS

quietFinn

Well-Known Member
Feb 4, 2006
1,840
426
438
Finland
cPanel Access Level
Root Administrator
cPanel does not overwrite Zone Templates, I've used edited templates for years and they never change.
Instructions here:
 
  • Like
Reactions: PeteS

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,307
2,238
363
cPanel Access Level
Root Administrator
@PeteS - Lauren doesn't hang out here much anymore, so you'll have to settle for my thoughts!

2 - Can you let me know what you mean when you say "control" ? What behavior are you looking for specifically?

3 - This one I'm not sure on. I'll see if I can find out more.
 

quietFinn

Well-Known Member
Feb 4, 2006
1,840
426
438
Finland
cPanel Access Level
Root Administrator
2- I would like control of these vars, especially %ttl%, %nsttl%, and %rpemail%. What can you tell me about that?
I have no idea where those variables come from, but you can replace any or all of them with hard-coded values in the Zone templates.
 

PeteS

Well-Known Member
Jun 8, 2017
380
85
78
Oregon
cPanel Access Level
Root Administrator
@PeteS - Lauren doesn't hang out here much anymore, so you'll have to settle for my thoughts!
I wondered about that... and I almost tagged you also, but that would have been annoying. ;)

I have no idea where those variables come from, but you can replace any or all of them with hard-coded values in the Zone templates.
By "control" I meant knowledge of where they are set/come from. Like how %rpemail% is set by the contact email. I assumed the twp TTLs are hard-coded somewhere on cPanel but wanted to ask if there was any reliable way to modify that. I do know they can be changed in the templates, but when I see a token I immediately want to know what connects to it.

For question 3, that's just something that happens in the interface. If you check the zone file itself you'll see the "@" is replaced with "."
Ah, ok. I should have checked that. Still, "hostmaster" is recommended. Maybe an option to use that default instead of the contact email in the future. Not a big enough deal for me to open a feature request. Just a thought.

I assume we can use either format in the templates? (host.domain.tld or [email protected])
 

quietFinn

Well-Known Member
Feb 4, 2006
1,840
426
438
Finland
cPanel Access Level
Root Administrator
I assume we can use either format in the templates? (host.domain.tld or [email protected])
Just because you can doesn't mean you should, if you look in RFCs and other documents they all say something like:
4.2 The RNAME Value
The RNAME is to publish a mail address of a person or role account dealing with this zone with the "@" converted to a ".". The best practice is to define (and maintain) a dedicated mail alias "hostmaster" [RFC 2142] for DNS operations.
That's in:
 
  • Like
Reactions: PeteS

PeteS

Well-Known Member
Jun 8, 2017
380
85
78
Oregon
cPanel Access Level
Root Administrator
Just because you can doesn't mean you should, if you look in RFCs and other documents they all say something like:

That's in:
Absolutely.

The point was in which format it goes into the template, since cPanel does some translation apparently, but the end result will be hostmaster.domain.tld in the actual record.
 

PeteS

Well-Known Member
Jun 8, 2017
380
85
78
Oregon
cPanel Access Level
Root Administrator
If you're putting it directly in the template, I'd stick with the email.address.tld format juuuuuuuuust in case.
Confirming: Using the format hostmaster.domain.tld in a template results in it showing as [email protected] in DNS Zone Manager, but the actual record in /var/named/ domain.tld.db is still hostmaster.domain.tld and of course propagates to nameservers as such.

I didn't bother with the "@" format in a template because, why...? :)

Thanks for the help.
 
  • Like
Reactions: cPRex