Failed to create virtual server : The DNS domain X is already hosted by your DNS server

So, I have looked at every other post with a similar title to mine, and none of them match my exact situation. Also, I had to take dots (.) out of all of the example domains below to get past the “new user max links in post” rule.

Versions:
CentOS 7
Apache/2.4.6 (CentOS)
PHP 7.4.2
Webmin version 1.941
Usermin version 1.791
Virtualmin version 6.08

Configuration:

  • I have my server setup to be my own nameserver so that it can serve out multiple domains.
  • To do that, I had to setup BIND DNS records prior to creating it as a virtual server.
  • When I try to create a virtual server for the nameserver’s domain (so it can host a landing page, nothing more than that), it gives the error from the subject line.

What I have tried:

  • Manual setup of Virtual Host in httpd.conf to point to domain.com and www example com with a document root of /var/www/html/

What happens:

  • You can browse to the http //example com page and it shows up. https //example com takes you to another virtual server on the machine as if it is redirecting, but there is no rule for redirection. I believe Apache is just picking something to do since it has no proper instructions.

Obviously, this is a circular issue, so I believe I need to find another way around it. What I probably need to do:

  • Set up a virtual server record in httpd.conf to manually point to the directory, but I do not know what I need to include to do this.
  • Need to be able to set up SSL so that http and https will take the client to the correct location.

Any thoughts on this? My GoogleFu has produced no meaningful results. I can’t be the only one to ever have had this problem, though. Perhaps a solution could be to show the things necessary for a virtual host entry. Perhaps mine was just not configured properly.

All VirtualHosts are set to *:80. That was a recommended fix somewhere else I saw, but it did not help this situation. My current VirtualHost entry (for the nameserver domain) in httpd.conf is this:

<VirtualHost *:80>
SuexecUserGroup "#1000" "#1000"
ServerName example com
ServerAlias www example com
#ServerAlias mail example com
#ServerAlias webmail example com
#ServerAlias admin example com
DocumentRoot /var/www/html
ErrorLog /var/log/example com
CustomLog /var/log/example com_access_log combined
 DirectoryIndex index.html index.htm index.php index.php4 index.php5
</VirtualHost>

I appreciate any help. And sorry if I missed anything. First post and all.

You need to use Import Virtual Server feature instead of Create Virtual Server.

I believe Apache is just picking something to do since it has no proper instructions.

It uses the default VirtualHost to display all other, undelegated requests.

Set up a virtual server record in httpd.conf to manually point to the directory, but I do not know what I need to include to do this.

Use mentioned above import server feature, later edit it and enable website feature.

All VirtualHosts are set to *:80. That was a recommended fix somewhere else I saw, but it did not help this situation.

You can safely revert it to default and let Virtualmin add it for you.

Thank you, I will keep this for when I can do it. Seems straightforward.

Now I have a whole host of issues with SSL/Let’s Encrypt to deal with separately from this. I appreciate your quick response. :slight_smile: