How to check if a domain is on the server

You have a lot of domains and you want to quickly check if a domain exists on the server. Just run the shell command: grep yourdomain /etc/userdomains

root@web [~]# grep /etc/userdomains plothost
root@web [~]#

In this case, the domain “” exists and it belongs to user “plothost”.

You may also want to know if the domain resolves to your server/IP. Use:

root@web [~]# dig

; <<>> DiG 9.9.0-RedHat-9.9.0-38.el7_3.2 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30116
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 512
;             IN      A

;; ANSWER SECTION:      5388    IN      A

;; Query time: 26 msec
;; WHEN: Mon Mar 20 04:11:52 PDT 2017
;; MSG SIZE  rcvd: 62

root@web [~]#

If the domain has an cPanel account you can search for it in WHM -> Account Information -> List Accounts.

WHM Search Account
WHM Search Account

On all our reseller plans you can host an unlimited number of domains. Check the offer here.

Share this post: