Why my website is not accessible with the www prefix

6,036

Solution 1

Okay so thanks everyone who wrote an answer, you guys helped me to get into the right track. The issue was related to double entries on GoDaddy and Route53.

I ended up doing the following:

  • On Godaddy on the main screen you see before you "Launch" domain ("Launch" = worst name ever given to something that opens settings, IMHO). And then setted up the NS servers to the ones that Route53 gives me, they are 4 exactly and are marked in yellow in the next image. enter image description here

  • I went inside this record and added all the records from GoDaddy to Route53, you should end with something like this:

enter image description here

  • Finally, on the Godaddy I erased all entries except CNAME entries, I initially had A, TXT and NS entries. This way now only Route53 administers all the entries.

Solution 2

I can think of two explanations, both relate to the DNS lookups:

  • It may be that one of the recursive resolvers you are using has cached a negative entry from before you created the CNAME. Whether it works or not depends on which resolver yo happen to be using at that particular time.
  • Possibly one of the involved servers is not correctly handling additional records associated with the CNAME. That could mean that the CNAME is returned without the A record as additional answer. But resolving the name without www will cause the needed A record to get cached and as long as it remains cached, it gets included as additional record.

You can try to resolve the domain name with and without www from a tool such as nslookup or dig. Try it with different recursive resolvers, try those provided by your ISP as well as some public resolvers (8.8.8.8 and 8.8.4.4 is a good pick).

Share:
6,036

Related videos on Youtube

adelriosantiago
Author by

adelriosantiago

Engineer and entrepreneur, know more about me at: www.adelriosantiago.com

Updated on September 18, 2022

Comments

  • adelriosantiago
    adelriosantiago over 1 year

    I know this is an old, and "amateur" question but I see myself in the need of making this question since I truly don't know whats going on.

    My website is not accessible with the www prefix... Actually it works sometimes and sometimes it does not. If I access the website without the www then it will suddenly start working with the www.

    After "doing my homework" I followed the next steps in order to solve it:

    -On my domain name service provider I added a A Record and a C NAME record that points to my website, it literally looks like this, I am assuming that GoDaddy is resolving @ to my web address since I actually hit the website sometimes:

    enter image description here

    -On my Virtual Host configuration file (httpd-vhost.conf in my case) I have this structure:

    NameVirtualHost *:80 
    <VirtualHost *:80>
      ServerName www.example.com
      ServerAlias example.com
    
      DocumentRoot my_htdocs_path
    
      <Directory my_htdocs_path>
        Option Indexes FollowSymLinks MultiViews    
        AllowOverride All
        Order allow,deny
        allow from all
      </Directory>
    </VirtualHost>
    

    I have 4 of these blocks, they all work perfectly but the most important one! (Murphy's law stuff).

    Whats going on? Can someone please give me a hint?

    Additional useful info:

    • Running an Amazon EC2
    • I'm using Route53 for the subdomain names
    • Everything used to work fine
    • Envite
      Envite almost 10 years
      Perform a DNS search (with host or dig, or nslookup) first to check if the names are actually resolving properly. And then connect to the server via telnet and ask it for the / page using HTTP 1.1 and the Host keyword. Paste the responses.
    • Ladadadada
      Ladadadada almost 10 years
      You're using Route53 for the subdomain names but you have pasted a screenshot of GoDaddy's web interface. If that description is correct, that would be your problem. It's much easier to figure these things out if you include your actual domain name. There's no rule against it here so as long as you don't mind, we'd prefer it.
    • adelriosantiago
      adelriosantiago almost 10 years
      @Envite the nslookup showed the message "DNS timeout", however I already solved it by remaking all the settings.