Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I get list of all hosted domains on centos server using bash command. I am runing centos server. I need to fetch the list of hosted domains on that server. I can get it using plesk. but It would be handy to know the way to do this using bash

share|improve this question
Which web server are you running? – quanta Jun 8 '12 at 16:01
what does it mean for a domain to be "hosted" in this context? Web servers? Mail? Anything else? – mattdm Jun 8 '12 at 16:17
up vote 4 down vote accepted

If you're using apache then

/usr/sbin/httpd -S 

Will will dump out a description of how Apache parsed the configuration file, which should be the configured hosts.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.