Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a web hosting account at HostGator (for a domain registered with Namecheap), where I would like to only use email, and completely turn off the website/webserver (for that domain), such that it actually gives the following error like any other domain which isn't pointing to anything, so in Firefox it would be:

enter image description here

Or in Chrome it would be:

enter image description here

So I am not looking for just a blank page or server 403 error, but literally for it to act like it doesn't exist and the only way someone would know that the domain is in use, is if they WHOIS search it or know any of the email addresses on the main server.

N.B. the domain is the parent domain in the HostGator account and other websites (which need to still be operational) are under it, but I'm thinking with DNS settings it can still be configured while keeping the one hosting account.

How would I configure this?

share|improve this question
add comment

3 Answers 3

If you want the website's email to be functional & website when browsed to show a Not Found page, simply point the A record to a non route able address. MX & other records should not be modified.

share|improve this answer
    
Thanks for your help, it led me to discover a more robust way (that wouldn't make some people's custom localhost be loaded up by my site's a record going to it), and found a cname method was more universally successful for what I want to do. Thanks again. –  foregon Apr 2 at 10:04
    
You are welcome. Glad to know that you got a solution. stackexchange has all the solutions :-) –  MilesWeb May 2 at 19:44
add comment
up vote 1 down vote accepted

The most robust method to make yourdomain.com or www.yourdomain.com return the 'host not found' error like the screenshots given, (and this works with HostGator), is the following process:

  1. Set the CNAME record for www.yourdomain.com to something that definitely is a domain that doesn't have a webserver attached to it, (i.e. a domain that completely doesn't exist), such as yourdomainnnnn.com (or any nonsensical domain that definitely doesn't exist).

  2. The above step only applies to www.yourdomain.com, not http://yourdomain.com without the www. To make sure people visiting your domain without the www definitely get the 'host not found' error, go to (or create) the .htaccess file in the root public_html folder and enter the following:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]

And it will work as desired.

share|improve this answer
add comment

The simplest solution is to configure your domain name's zone file to NOT have any CNAME, A, or AAAA records for www.example.com and example.com.

Where example.com is your domain name.

share|improve this answer
add comment

Your Answer

 
discard

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.