Accessing my web page without the 'www'

  • Posted on September 2, 2015
  • DNS
  • eKulzAsked by eKulz

Currently I have a droplet ‘’ which works accessed via and

I also have ‘’ setup which only works when accessed via, but not

Am i able to set it up so a user can type ‘www’ before ‘’?


Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@eKulz - You really don’t need the CNAME entry. You can use a WildCard DNS entry to handle all sub-domain routing, which will prevent you from having to handle multiple DNS entries over time and allow you to do the configuring at the web server level.

Adding an A entry using an asterisk ( i.e. * ) and setting the hostname to your Droplet IP will route all requests for sub.domain.ext to domain.ext unless the sub-domain is defined in your web server configuration or a directory with that name exists.

As an example, I’ll use NGINX. NGINX will require that you setup your server block to use the WildCard Entry by defining it. As you can see below, normally you’d use, though to ensure proper routing, we use an asterisk - save & reload NGINX.

server {
    listen       80;
    server_name *;

Now, if we go to, we’ll see the content of If we wanted to ensure displayed its own content, we’d simply setup a server block for it.

server {
    listen       80;

Since we have a WildCard DNS entry in place, we don’t need to create another DNS entry, regardless of how many additional server blocks we create (i.e., etc).

Question can be removed, I managed to get it working

I added a CNAME record name: ‘’ hostname: ‘