Problem w creating NS records for domains

lukgier

Verified User
Joined
Mar 16, 2025
Messages
25
Hi,

After installation 1.683 I have problems with creating NS records.

After adding a domains it creates ns1(2).da.ambientunes.com insted of ns1(2).ambientunes.com / withouth .da.

In Administrator Settings > Server there are:
da.ambientunes.com / teh same as PTR
NS1/NS2: ns1./ns2.ambientunes.com

My dns_ns.conf

Code:
|NS1|=|DOMAIN|.
|NS2|=|DOMAIN|.

My directadmin.conf
Code:
acme_server_cert_enabled=1
add_userdb_quota=1
apache_public_html=0
awstats=0
backup_gzip=2
brute_force_log_scanner=1
brute_force_scan_apache_logs=2
check_subdomain_owner=1
cloud_cache=0
cluster=1
dkim=2
dns_ttl=1
dnssec=1
dovecot_legacy=0
ethernet_dev=enp5s0
hide_brute_force_notifications=1
ipv6=1
jail=1
letsencrypt=1
litespeed=0
mail_sni=1
nginx=0
nginx_proxy=1
ns1=ns1.ambientunes.com
ns2=ns2.ambientunes.com
openlitespeed=0
php_fpm_max_children_default=10
plugins=1
pureftp=1
quota_partition=/
secure_access_group=access
servername=da.ambientunes.com
ssl=1
system_user_to_virtual_passwd=1
webmail_link=roundcube

Could you please tell me what else I should check.
 
dns_ns.conf is a template that DA uses to create your DNS Zone files, so editing that won't end well if you're not sure what you're doing. the ns values you have set in the directadmin.conf are there so that DA knows what ns records to assign to each new domain.

Check under Admin -> Administrator settings -> Server and see if the servername and nameservers are correctly set.

Also check under Admin -> Nameservers to see if your nameservers are also as you require them. If not, you're able to create them there and DA should update itself.

1757072704046.png


Note: If you only have 1 IP assigned to your server, you won't get the dropdown "Select" boxes as shown above for the server IP. You'll have to create virtual nameservers.
 
Last edited:
dns_ns.conf is a template that DA uses to create your DNS Zone files, so editing that won't end well if you're not sure what you're doing. the ns values you have set in the directadmin.conf are there so that DA knows what ns records to assign to each new domain.

Check under Admin -> Administrator settings -> Server and see if the servername and nameservers are correctly set.

Also check under Admin -> Nameservers to see if your nameservers are also as you require them. If not, you're able to create them there and DA should update itself.

View attachment 9270

Note: If you only have 1 IP assigned to your server, you won't get the dropdown "Select" boxes as shown above for the server IP. You'll have to create virtual nameservers.

Thank you for you reply.

In Administrator Settings > Server there are:

Hostname: da.ambientunes.com / the same as PTR

NS1: ns1.ambientunes.com
NS2: ns2.ambientunes.com

I was doing installation in terminal mode, all configuration was made from config files.

Now for new domains it puts ns1.da.ambientunes.com instead of ns1.ambientunes.com and I have no clue what else I should check.
 
I was doing installation in terminal mode, all configuration was made from config files.
That is not advised. Best is to only change (if needed) /etc/hosts and /etc/hostname and /etc/resolv.conf but no DNS files.

Go into GUI mode, click "nameservers" and setup your namesevers there, use virtual nameservers.
Then afterwards under your ambientunes.com domain, check you got the appropriate ns1 and ns2 A and NS records.
 
Below what I've got. Is this ok?

hosts
Code:
127.0.0.1 localhost.localdomain localhost
94.130.52.77 da.ambientunes.com da
::1 localhost ip6-localhost ip6-loopback


fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

2a01:4f8:10b:29d9::2 da.ambientunes.com da

hostname
Diff:
da

resolv.conf

Code:
# nameserver config
nameserver 185.12.64.2
nameserver 2a01:4ff:ff00::add:1
nameserver 185.12.64.1
nameserver 2a01:4ff:ff00::add:2
 
The hostname in /etc/hostname normally is correct, but it's better to use the full hostname there.
So I would suggest to change it to your full FQDN hostname (da.ambientunes.com) instead.

Rest looks all fine.
 
But you still need to configure the rest via the GUI as mentioned (virtual hostnames and check A and AAA for ns1 and ns2 and NS records (2 pieces) for the domain.
 
I did you you say, I created nameservers as below, but stil when I add new domain I get NS records:

test3.pl. NS ns1.da.ambientunes.com.
test3.pl. NS ns2.da.ambientunes.com.

I restarted directadmin, bind9 before adding new domain.
 

Attachments

  • amb3.jpg
    amb3.jpg
    144.5 KB · Views: 17
  • amb2.jpg
    amb2.jpg
    46.5 KB · Views: 17
  • amb1.jpg
    amb1.jpg
    37.3 KB · Views: 18
I added AAA records for NS1/2 as you said and now it works for domains on new accounts I create. On old account it still makes ns1.da.amb... but it's not a problem, I can live with it.

Thank you for your help 🙏 You've been much more helpful than GPT which only wasted my time.
 
dns_ns.conf is a template that DA uses to create your DNS Zone files, so editing that won't end well if you're not sure what you're doing. the ns values you have set in the directadmin.conf are there so that DA knows what ns records to assign to each new domain.

Check under Admin -> Administrator settings -> Server and see if the servername and nameservers are correctly set.

Also check under Admin -> Nameservers to see if your nameservers are also as you require them. If not, you're able to create them there and DA should update itself.

View attachment 9270

Note: If you only have 1 IP assigned to your server, you won't get the dropdown "Select" boxes as shown above for the server IP. You'll have to create virtual nameservers.

Thank you very much 🙏 Your advise has been very helpfull.
 
I changed ns1/ns2 in /usr/local/directadmin/data/users/OLD-USER/user.conf and now new domains on old accounts get correct NS1/NS2 :)
 
On old account it still makes ns1.da.amb... but it's not a problem, I can live with it.
You can always change that manually via DNS administration too, first add the correct one and then remove the incorrect one.

I just discovered it seems you did not implement ipv6 correctly in Directadmin. If you want to use it, then on newly created domains, the same ipv6 records (like mail, www and ftp) should be created as are created for ipv4.

In your last screenshot, I only see ipv6 for the hostname and both NS records. If you only use that for ipv6 it's ok.
But if you need to use ipv6 for all your domains, you might need to do some additional work so they are setup automatically too on new domain creation.
 
Could you tell me what to change / add to automaticaly set ipv6 for new domains? Just a shortlist should do :)
 
I will try. :)
Code:
/usr/local/directadmin/directadmin set ipv6 1 restart
/usr/local/directadmin/dataskq d

Then in DA itself in the IP Manager, add your ipvt like:
xx:xx:xx:xx:xx:xx:xx/64

After adding your ipv6 to the ip manager you have to link the ipv6 to the ipv4. Some people make a little mistake here because they do it the other way around.
The correct way is that in the ip manager you click your ipv4 and then link the ipv6 to it and also select both "add to dns" and "add to apache" and then click link button.

It can take a minute or two as DA will do some updates in the background too.

Then check if when you create a test domain you also got all ipv6 records with it.
If not then try via SSH again:
da build rewrite_confs
and try again.

You can then use the rebuild dns for existing domains which do not have the records yet.

Be sure to doublecheck your already created records, they might change or be overwritten, so jus to be sure doublecheck afterwards.
 
Back
Top