This one is really weird. I've got an Apache web server running on Ubuntu 14.04 with DNS provided by AWS's Route53. When I point a browser (or CURL in a console) to example.com with the http://www in front, the request fails. CURL returns

curl: (6) Could not resolve host: www.example.com

But when I point the same browsers/consoles to example.com, everything works perfectly. /var/log/apache2/error.log reports nothing. Restarting Apache didn't help. As far as I can see, my DNS record set is fine. Any ideas?

closed as off-topic by MadHatter, kasperd, mdpc, womble Oct 17 '15 at 3:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Did you set up a record for the www subdomain? Give us the domain and the records you have in place. – ceejayoz Oct 16 '15 at 19:37
  • No I didn't. There's just the A record pointing to the IP address. Full addresses were working fine a couple of days ago (as far as I remember). I'll tried adding a new A record for www.mysite – dlanced Oct 16 '15 at 19:42
  • 3
    www.example.com and example.com are totally separate FQDNs and have their own separate records. – ceejayoz Oct 16 '15 at 19:45
  • Doesn't really matter. You can make both records be A records, or you could CNAME www at non-www. Both are fine, the CNAME will save you having to change both records if your IP changes. – ceejayoz Oct 16 '15 at 19:48
  • 1
    I'm voting to close this question as off-topic because it fails to exhibit the minimum level of professionalism and research required for ServerFault. – MadHatter Oct 16 '15 at 20:06

curl: (6) Could not resolve host: www.example.com

You need to create a DNS A or CNAME record for www.example.com.

  • Thanks! You and ceejayoz were bang on. I can't imagine how I didn't notice this until now... – dlanced Oct 16 '15 at 19:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.