Home > Amazon S3 > Mapping Amazon AWS S3 to a Custom Domain Name

Mapping Amazon AWS S3 to a Custom Domain Name

According to Amazon’s Developer Guide you can setup Virtual Hosting of your files by adding a CNAME in your DNS server. I’ve sinced mapped a subdomain s3.brangle.com to Amazon’s S3 cloud.

The way I did this was to create a CNAME entry on my DNS server mapping
s3.brangle.com to s3.brangle.com.s3.amazonaws.com.
and yes, that is a period at the end of s3.brangle.com.s3.amazonaws.com. Now just creating the CNAME entry only redirects users to Amazon S3, Amazon needs to know which bucket to use. The name of the bucket needs to be the fully qualified domain name (FQN) that you are using. So in my example, my bucket name is s3.brangle.com.

In general, if you want to create subdomain.domain.com then your bucket will have to be named subdomain.domain.com. I was under the impression that I could create s3.brangle.com and name the bucket whatever I wanted with a

According to Amazon Web Services

Customizing Amazon S3 URLs with CNAMEs

Depending on your needs, you might not want “s3.amazonaws.com” to appear on your web site or service. For example, if you host your web site’s images on Amazon S3, you might prefer http://images.johnsmith.net/ as opposed to http://johnsmith-images.s3.amazonaws.com/.

The bucket name must be the same as the CNAME. So http://images.johnsmith.net/filename would be the same as http://images.johnsmith.net.s3.amazonaws.com/filename if a CNAME were created to map images.johnsmith.net to images.johnsmith.net.s3.amazonaws.com.

Any bucket with a DNS compatible name may be referenced as follows: http://[BucketName].s3.amazonaws.com/[Filename], for example, http://images.johnsmith.net.s3.amazonaws.com/mydog.jpg. Using CNAME you can map images.johnsmith.net to an Amazon S3 host name so the previous URL could become: http://images.johnsmith.net/mydog.jpg.

The CNAME DNS record should alias your domain name to the appropriate virtual hosted style host name. For example, if your bucket name (and domain name) is images.johnsmith.net, the CNAME record should alias to images.johnsmith.net.s3.amazonaws.com.

**Edit 13 Dec 2011 – Updated AWS developer guide link

Categories: Amazon S3 Tags: , , ,
  1. No comments yet.
Comment pages
1 2 618
  1. May 3rd, 2020 at 21:13 | #1
  2. May 6th, 2020 at 17:22 | #2
  3. May 6th, 2020 at 17:39 | #3
  4. May 8th, 2020 at 11:46 | #4
  5. May 10th, 2020 at 01:58 | #5
  6. May 10th, 2020 at 09:27 | #6
  7. May 12th, 2020 at 18:24 | #7
  8. May 13th, 2020 at 02:34 | #8
  9. May 13th, 2020 at 06:11 | #9
  10. May 13th, 2020 at 10:59 | #10
  11. May 13th, 2020 at 18:17 | #11
  12. May 13th, 2020 at 21:00 | #12
  13. May 14th, 2020 at 00:58 | #13
  14. May 14th, 2020 at 12:41 | #14
  15. May 14th, 2020 at 16:18 | #15
  16. May 16th, 2020 at 16:18 | #16
  17. May 16th, 2020 at 21:10 | #17
  18. May 16th, 2020 at 22:08 | #18
  19. May 17th, 2020 at 09:17 | #19
  20. May 17th, 2020 at 10:13 | #20
  21. May 17th, 2020 at 23:18 | #21
  22. May 19th, 2020 at 01:14 | #22
  23. May 19th, 2020 at 03:00 | #23
  24. May 19th, 2020 at 13:27 | #24
  25. May 19th, 2020 at 13:49 | #25
  26. May 20th, 2020 at 01:11 | #26
  27. May 21st, 2020 at 04:39 | #27
  28. May 21st, 2020 at 19:46 | #28
  29. May 23rd, 2020 at 13:17 | #29
  30. May 23rd, 2020 at 14:48 | #30
  31. May 25th, 2020 at 06:43 | #31
  32. May 25th, 2020 at 09:03 | #32
  33. May 26th, 2020 at 01:22 | #33
  34. May 26th, 2020 at 02:52 | #34
  35. May 27th, 2020 at 23:09 | #35
  36. May 28th, 2020 at 10:07 | #36
  37. May 31st, 2020 at 21:14 | #37
  38. June 1st, 2020 at 19:01 | #38
  39. June 2nd, 2020 at 17:27 | #39
  40. June 3rd, 2020 at 02:19 | #40
  41. June 4th, 2020 at 13:23 | #41
  42. June 4th, 2020 at 21:17 | #42
  43. June 5th, 2020 at 14:09 | #43
  44. June 5th, 2020 at 15:57 | #44
You must be logged in to post a comment.