Hestiacp change DNS record for all users to create new domains

Hello.

I need to change DNS record WWW to type A for all users, so that when creating new domains, it automatically becomes an A record and instead of the domain, the IP address is substituted in the IP or value field. In default it’s CNAME type with domain in IP or value field

How to do it?

Hi,

You need to create a new DNS template with the required change and assign that template as the default for the package your users will use.

Example:

cd /usr/local/hestia/data/templates/dns
cp default.tpl yuri.tpl

Now edit yuri.tpl and replace this:

ID='10' RECORD='www' TYPE='CNAME' PRIORITY='' VALUE='%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'

with this:

ID='10' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%.' SUSPENDED='no' TIME='%time%' DATE='%date%'

Now you should edit the package used by your users and replace this:

DNS_TEMPLATE='default'

with this:

DNS_TEMPLATE='yuri'

For example, if your users are using the default package:

cd /usr/local/hestia/data/packages
sed -i "s/^DNS_TEMPLATE.*/DNS_TEMPLATE='yuri'/" default.pkg

To avoid issues when updating Hestia, it’s better if you create a new package for your users and made the modification to that new package, and then assign it to your users.

You can do this part from Web UI if you prefer.

Please explain what to write here? Is the last one a user? Default.tpl ?
cp default.tpl yuri.tpl

No, it’s not a user, is just a name, choose the name you want.

I’m not understand for example i have user Admin.

What will this line look like? - “cp default.tpl yuri.tpl’”

The template is not related to any user, is just a name, you can use yuri.tpl, newtemplate.tpl. default-custom.tpl, etc.