How to Use a Custom Domain with Dropbox Public Links

DropboxAre you a Dropbox user? Do you frequently share files using the Public folder feature? Would you like to have the public links be something other than dl.dropbox.com?

Dropbox allows files to be placed in a “Public” folder. Each file in this folder has a special public link that can be shared with others. All files have a link in this format: dl.dropbox.com/u/useridnumber/filename.extension.

We previously showed you how to host a website for free using Dropbox, but suppose you wanted a better looking URL. Here’s how to accomplish that.

CNAME Record

With a CNAME (Canonical Name) DNS Record, you can have a custom domain or sub-domain point to dl.dropbox.com. All you need is your own domain name. Free sub-domains work too as long as you have access to DNS.

With this method, your URLs would look something like files.myowndomain.com/u/useridnumber/filename.extension. Since this method points your domain to Dropbox, there is no way to customize the sub-directories part.

  1. Login to your domain’s DNS control panel. This will vary depending on your domain registrar or hosting provider.
  2. Create a new CNAME entry for any hostname you choose, such as ‘dl’ or ‘files’ and have it point to dl.dropbox.com.
    Dropbox CNAME
  3. Click save and you’re done! Remember that DNS can take up to 48 hours to fully propagate.
  4. Try out your new link. Copy any Dropbox public link and replace the domain name with your own.
Dropbox Custom Domain

A simple website hosted by Dropbox. Notice the URL.

Another limitation to this method is that anyone can use your custom domain for their own Dropbox links. This carries the risk of having your domain be used to serve malicious files, resulting in it being blacklisted by various services such as Norton SafeWeb.

When someone downloads a file from you, the browser will say downloading from dl.myowndomain.com instead of dl.dropbox.com. This makes it look much more professional if you’re using Dropbox to host files.

Load in Frame

You can have the Dropbox page load in a frame on your own website domain. Simply add this line of code to your site replacing the URL part with your Dropbox public link.

<iframe src="http://dl.dropbox.com/u/useridhere/website/index.html" width="100%" height="100%">
  <p><a href="http://dl.dropbox.com/u/useridhere/website/index.html">Your browser does not support frames. Please click here instead.</a></p>
</iframe>
Dropbox Frame

The same webpage as above but loaded through a frame. Notice the URL.

The limitation to this method is that if its being used to serve multiple webpages, the URL bar will always show the same URL.

Of course, you can always just have a URL redirect to a Dropbox link, but that would still show the original Dropbox URL.

Have another method for using a custom domain with Dropbox public links or another tip for us about using Dropbox? Share with us in the comments.

By
Brian is the co-founder of TechAirlines. He is a web developer and manages most of the site’s operations. He is currently a freshman at Stony Brook University, majoring in Computer Science.

  • http://brian.tk/blog/ brian

    You use CloudFlare too!

    • http://www.techairlines.com Brian Yang

      Yup. CloudFlare is being used here at TechAirlines.

      The screenshot above of editing DNS was from CloudFlare’s DNS Editor.

  • http://Www.mcneri.com Mcneri

    I love cloudflare. Incapsula is another similar service. I wanted to find a way to make Dropbox files download automatically. Nice info about dropbox. Thanks.0

  • Pingback: 换图床不如换思路,Dropbox绑定域名继续外链 | 亦斯

  • http://yisi.us yisi

    Thank you for your sharing ! :)

    I have made it more charming in China.= =

    • http://www.techairlines.com Brian Yang

      And thank you for sharing this post on your site!

  • Damien Lay

    http://www.kissr.co

    Redirects plus root documentation for auto navigation to index.html etc!

  • http://hmoe.me/ 魔法基佬MKⅡ

    Thanks for sharing,but this approach has failed,visit domain that point to dl.dropbox.com,will be redirected to dl.dropboxusercontent.com.

    • http://www.techairlines.com/ Brian Yang

      Dropbox just updated their public links to use dl.dropboxusercontent.com instead of dl.dropbox.com. I am updating the article to reflect these changes.

      • http://hmoe.me/ 魔法基佬MKⅡ

        I tried to point a domain to dl.dropboxusercontent.com, but still will be redirected to dl.dropboxusercontent.com. Means that in any way pointed the domain to public link, will be redirected.