Duplicate dns records (NS) for new domains

Created:

2016-11-16 13:12:47 UTC

Modified:

2017-08-16 16:23:43 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Duplicate dns records (NS) for new domains

Applicable to:

  • Plesk 10.x for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

Plesk began to duplicate some DNS records for newly created domains. For example this zone contains duplicate ' NS ' records.

Home -> Subscriptions -> 'testparallels.com' -> Websites & Domains -> DNS Settings:
testparallels.com. NS ns1.domain.tld.
testparallels.com. NS ns1.domain.tld.
testparallels.com. NS ns2.domain.tld.
testparallels.com. NS ns3.domain.tld.
testparallels.com. NS ns4.domain.tld.
testparallels.com. NS ns4.domain.tld.
testparallels.com. NS ns3.domain.tld.
testparallels.com. NS ns2.domain.tld.
*.testparallels.com. A 10.10.10.10
*.testparallels.com. A 10.10.10.10
mail.testparallels.com. A 10.10.10.10
mail.testparallels.com. A 10.10.10.10
testparallels.com. A 10.10.10.10
testparallels.com. A 10.10.10.10
www.testparallels.com. CNAME testparallels.com.
testparallels.com. MX (10) mail.testparallels.com.
testparallels.com. MX (10) mail.testparallels.com.
17 DNS records total

Cause

Root cause is in race condition during subscription creation and event handler execution.Such behavior was considered as a bug #PPPM-1012 .

Event handler on domain creation could contain command similar to next one:

# /usr/local/psa/bin/subscription_settings -u <new_domain_name> -mbox_quota -1 -max_site 1 -expiration -1 -www true -no_usr reject -wuscripts false -manage_crontab true -manage_domain_aliases true -select_db_server true

Resolution

1) To fix duplication of the DNS records, please remove event handler, or add some timeout to executed command, e.g.:

    # sleep 3 && /usr/local/psa/bin/subscription_settings -u <new_domain_name> -mbox_quota -1 -max_site 1 -expiration -1 -www true -no_usr reject -wuscripts false -manage_crontab true -manage_domain_aliases true -select_db_server true

Already existent duplicates should be removed manually by restoring the DNS zone to the default state according to DNS template via Plesk Panel GUI.

2) There is also a possibility to add a new Event handler for event 'Default domain (the first domain added to a subscription/webspace) created the following script:

#!/bin/bash
/usr/local/psa/bin/dns --reset ${NEW_DOMAIN_NAME} -ip ${NEW_IP_ADDRESS}
Have more questions? Submit a request
Please sign in to leave a comment.