a friend of mine had recently bought some domain (domain1.com, domain2.net, domain3.org) and he wants to forward them to the main one (maindomain.com).

The hosting is on a shared server (not a private server) with cpanel without being able to park domains.

Since those are not subdomains (e.g. sub1.maindomain.com) it's not possible to set CNAME records.

What could be the possible solutions, without paying hosting for every domain and then redirect (301), in order to achieve what he wants?


I don't see how a cname is relevant, however to the extent it might be there are at least 2 ways to handle this component - by far the easiest is to replace them with an A record. I'm not sure if you realise it but with respect of http/http a DNS record only point to a server - there is no mechanism to manipulate/forward sites within DNS

Unfortunately the answer for the "heavy lifting" component is likely "you can't", but it will depend on the hosting provider and whether you want to do http or https.

For http, if you can get a static IP for only your sites, and if your provider supports it, you can use IP based virtual hosting, which means the webserver will answer the same for all websites which match that IP. Unfortunately, https breaks the above due to certificate negotiation. You will need a way to generate a certificate listing all the hosts being answered for, and keep on updating it. Practically there is no way arroubd thus unless you ignore cert warnings or can create your own CA.

An alternative to the IP based virtual hosting method would be to stick with domain based hosting but programming in all the domains as aliases.

  • CNAME is not effectively relevant because I cannot refer to a domain, but to a subdomain of the same website (at the beggining I was thinking otherwise, I didn't know about that). So the possible solutions are just setting virtual hosts or aliases on the web server? Did I understand correctly? – bomba Nov 24 '19 at 17:32
  • I don't understand what you are saying about cnames (and the devil is in the details here). With respect of the virtual hosts, yes. – davidgo Nov 24 '19 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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