• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved List all domains in Plesk that do _not_ point their A record to the server Plesk is installed on.

nilsringersma_nl

Basic Pleskian
Dear all,

Using: Plesk Onyx for Linux
OS: CentOS7

When adding a domain that does not point it's A record for @ to the server, Plesk will show a message about the DNS not pointing to the server.

Would it be possible to use the same mechanism to generate a list of all domains in Plesk Onyx that do not point to the server? Or can I not use Plesk for this and should I write something myself?

Any help or tips are appreciated, thanks in advance!
 
Check if this is enough?

#plesk db
mysql> select displayHost, val from dns_recs where type="A" and val <> 'xx.xx.xx.xx';

Where xx.xx.xx.xx is IP of your Plesk server.
 
Check if this is enough?

#plesk db
mysql> select displayHost, val from dns_recs where type="A" and val <> 'xx.xx.xx.xx';

Where xx.xx.xx.xx is IP of your Plesk server.

Hi IgorG,

Thanks for your reply and assistance!

Sadly we do not use the integrated DNS within Plesk, but DNS records are stored on an external nameserver. Therefor the table dns_recs returns an empty set.

I thought because Plesk initially shows the "Your domain does not point to <server_ip>" message after adding a domain to Plesk, it could be possible to dig from Plesk to show the actual A record for it's domains. But maybe I should try to generate a list of domains and then write a bash script to check their A records. Or do you have a better idea?

Thanks again :), much appreciated!
 
With command like

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do dig $i A +short; done

you will get only IPs of domain's A records.

But with command like

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do dig $i A +nostats; done

you will get more information :)
 
With command like

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do dig $i A +short; done

you will get only IPs of domain's A records.

But with command like

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do dig $i A +nostats; done

you will get more information :)

That's exactly what I was looking for! Thank's again Igor :)!
 
Back
Top