Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Setting ServerAlias for a cPanel account

Discussion in 'Bind/DNS/Nameserver' started by Mozai, Apr 17, 2015.

  1. Mozai

    Mozai Member

    Oct 21, 2014
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    I'm trying to add a serveralias for a cPanel account, but cPanel won't let me. I understand it wants to stop me from shooting myself in the foot, but just because I've pointed the gun down doesn't mean my foot is always under it.

    I have an account on a machine where I have both WHM and cPanel access. The account's website has two hostnames I'll call "" and "" for the same website. I wish to add another hostname "" because we'll soon acquire that domain name and I wish for the transition to be seamless when DNS is updated.

    If I wasn't using cPanel/WHM, I'd just edit /etc/apache/*.conf, add or update a 'ServerAlias' line and be done.

    In cPanel for the account, I go to Domains >> Parked Domains, try to add "" and cPanel refuses because that hostname doesn't currently point to this host. I already know this, and I'm okay with this, but cPanel doesn't give me the option of going ahead.

    I've tried editing /var/cpanel/users/$accountname to add another "XDNS?=" line, then run
    /usr/local/cpanel/scripts/updateuserdomains , but /var/cpanel/userdata/$accountname/* doesn't mention the new XDNS3 entry... so the next time cpanel refreshes the apache configuration, the extra serveralias will not appear (or will get erased if someone edited /usr/local/apache/conf/httpd.conf by hand).

    How do I get WHM/cPanel to add another hostname to the ServerAlias config setting for an apache vhost, without erasing it later, and despite the fact that the hostname doesn't currently point to this server's IP address(es) ?
  2. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    May 20, 2003
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    This may be of some use:

    WHM » Server Configuration » Tweak Settings, Domains tab, enable this, add your domain, and then disable afterward.

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Mozai likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice