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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Website resolving on nameserver domain

Discussion in 'Bind/DNS/Nameserver' started by Will W., May 17, 2018.

  1. Will W.

    Will W. Registered

    Joined:
    May 17, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Texas
    cPanel Access Level:
    Root Administrator
    Hello,

    I am unable to locate this in other threads or i am searching for it incorrectly.

    my nameserver domain let say "ns1.nsdomain.com"
    website domain is "anotherdomain.org" on same ip as nameserver

    http://ns1.nsdomain.com resolves the website for http://anotherdomain.org.

    besides moving the website to a different ip address. how would i keep my nameserver domains from resolving to another website located on the server.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,298
    Likes Received:
    1,765
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @Will W.,

    You can follow the steps referenced below to control what shows up when accessing a domain name that points to the cPanel server but isn't configured with Apache (e.g. ns1.nsdomain.tld):

    1. Navigate to WHM's Include Editor interface (WHM Home >> Service Configuration >> Apache Configuration >> Include Editor).

    2. Select the Pre Virtual Host Include option.

    3. Select the Apache version from the menu. We recommend that you select All Versions.

    4. Enter the following text in the available text box:

    Code:
    <VirtualHost IPADDRESS:80>
      ServerName HOSTNAME
      DocumentRoot /usr/local/apache/htdocs
      ServerAdmin EMAIL
      <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
      </IfModule>
     </VirtualHost>
    
    <VirtualHost IPADDRESS:443>
      ServerName HOSTNAME
      DocumentRoot /usr/local/apache/htdocs
      ServerAdmin EMAIL
      <IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
      </IfModule>
        SSLEngine on
        SSLCertificateFile SSLCERTIFICATEFILE
        SSLCertificateKeyFile YOUR-SSLCERTIFICATEKEYFILE
     </VirtualHost>
    Note:

    This example uses the following values:
    • IPADDRESS represents the server's IP address.
    • HOSTNAME represents the domain name you want to setup (e.g. ns1.nsdomain.tld).
    • EMAIL represents your contact email address.
    • SSLCERTIFICATEFILE represents the full file path to your SSL certificate.
    • SSLCERTIFICATEKEYFILE represents the full file path to your SSL certificate's key.
    5. Click Proceed
    6. Click Update.

    Additionally, note that you'd need to update the DocumentRoot values to reflect a directory with an index file with the content you want to appear or with an .htaccess file that denys access.

    Thank you.
     
Loading...

Share This Page