MX Records on all domains of Plesk

Community support for Plesk, CPanel, WebMin and others with insight from two of the founders of Plesk. Ask for help here! No question is too simple or complicated. :-)
Choji
Forum User
Forum User
Posts: 28
Joined: Mon Sep 10, 2012 10:00 am
Location: United Kingdom

MX Records on all domains of Plesk

Unread post by Choji »

Hi guys,

I'm trying to list the domains and their nameservers on our plesk server.

For a single domain, I'd go to the Plesk control panel and go to "websites/domains" -> "dns settings".

I want to do that for over 100 domains and there should be a better way to do this than looking up individually.

I've been looking at the mysql databases in /etc/psa but there doesn't seem to be a table for this.
It should be similar to dns_recs but not just for our main domain.

Any ideas?
prupert
Forum Regular
Forum Regular
Posts: 573
Joined: Tue Aug 01, 2006 2:45 pm
Location: Netherlands

Re: MX Records on all domains of Plesk

Unread post by prupert »

You can bash script a DNS lookup in a for loop to get the DNS-records for all your domains. Which records do you want to retrieve?

Example:

Code: Select all

for domain in `mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -e 'select name from psa.domains'`; 
dig MX $domain
done
Be advised that if you are using your Plesk machine as the local resolver that you can get false results if your local nameserver incorrectly contains records for domains that are actually registered elsewhere.
Lemonbit Internet Dedicated Server Management
Post Reply