apachewebdnscnamea-records

DNS record for help.example.com returns 404


I have a domain example.com. I'd like to map help.example.com to example.com. The DNS records are:

Hostname           Type     Value
example.com        A        93.184.216.34
help.example.com   A        93.184.216.34
www.example.com    CNAME    example.com

I can access the website with both example.com and www.example.com but when I try help.example.com I get 404 Not Found.:

Not Found
The requested URL / was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

So I'd like to know why is the A record for help.example.com not redirecting to example.com.


Extra information:


Solution

  • Your problem is in webserver configuration. Not in DNS at all.
    I assume you use Apache so you need to tell Apache that example.com www.example.com help.example.com have same root directory.
    For example if you use VirualHost configuration and Ubuntu then look in /etc/apache2/sites-enabled/example.com.conf
    It should have

    <VirtualHost *:80>
        ServerAdmin admin@example.com
        ServerName example.com
        ServerAlias www.example.com help.example.com
        ...
    </VirtualHost>
    

    If you use other OS/configuration/WebServer you can google/look how your configuration works and where to add your domain name. Not in DNS.