-4

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?

MadHatter
  • 79,770
  • 20
  • 184
  • 232
dlanced
  • 247
  • 1
  • 4
  • 13
  • 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

1 Answers1

4

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

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

Joel Coel
  • 12,932
  • 14
  • 62
  • 100
EEAA
  • 109,363
  • 18
  • 175
  • 245