1

I've just set up nextcloud according to this guide:

https://www.linuxbabe.com/ubuntu/install-nextcloud-11-ubuntu-16-04-nginx-config

It's on a DigitalOcean VPS and I have the domain name dynamically allocated with a service called duckdns, so that I can reach my nginx webserver by simply typing:

bitofagoob.duckdns.org

Now, I understand how this part works. My VPS is running a script which informs duckdns of which IP address I'm at by pinging it every 10 minutes. When I want access to my VPS I just go via the duckdns service and I'm redirected to the relevant IP, even if it changes.

What I don't understand is how this is now working:

nextcloud.bitofagoob.duckdns.org

^this now gives me my new nextcloud server landing page.

How can a domain be transformed like this? If I think of a domain like this:

[email protected]

Then I am aware that I can control everything to the left of the '@' by adding new users/accounts etc, but how have I just been able to change something to the right of the '@'?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
bitofagoob
  • 1,335
  • 2
  • 15
  • 24

1 Answers1

3

First, you're confused on what a domain name is. [email protected] is not a domain name; it's an email address (or maybe XMPP/Jabber address, or a bunch of other things that follow that format). It is made up of a local part (bitofagoob), a delimiter (@), and a fully-qualified domain name (my.domain.com).

A domain name is any name that's resolvable via DNS. A fully-qualified domain name is one that isn't omitting part of the suffix; e.g., you might be able to resolve myhostname, because your system knows to try adding mydomain.com to the end automatically. myhostname.mydomain.com is the fully-qualified domain name. Typically abbreviated FQDN. You can add a period at the end of the name to tell the local DNS resolver that is a FQDN and not to try adding any configured search suffixes.

DNS is organized into a hierarchy, starting from the right hand side of the FQDN. Each level decides who controls the next level down; you start at the right with the root domain (.) (controlled by ICANN); then get to com. (controlled by Verisign under contract with ICANN, and allowing open registration through many registrars). ICANN has decided that the registrant of a com. sub-domain (such as domain.com.) controls it.

So then the registrant of domain.com. has decided to make my.domain.com. work. They can create as many more levels as they want (within reason, I'm pretty sure DNS has a limit), and delegate control of those levels to whomever they desire (or keep control themselves).

The folks controlling duckdns.org set up a "wildcard" for you—they made anything.bitofagoob.duckdns.org resolve the same as bitofagoob.duckdns.org. (This is relatively easy to do with most DNS server software.)

derobert
  • 107,579
  • 20
  • 231
  • 279
  • Ah. So the way that domains are resolved is back to front, in this case starting with `com`, then `duckdns.com`, then `bitofagoob.duckdns.com`? By this stage, anything further to `bitofagoob.duckdns.com` is handled by my DDNS service and because they know the IP of my FQDN they then appended the `nextcloud` part on to end up with `nextcloud.bitofagoob.duckdns.com`? – bitofagoob Jul 09 '17 at 17:29
  • To that end, if I started another webserver and called the landing page `mynewpage.bitofagoob.duckdns.com` but didn't enable it then the server at duckdns would still try and send me there if I typed it in my browser? This would result in a 404 until I started the service properly? – bitofagoob Jul 09 '17 at 17:44
  • @bitofagoob yes, it'd resolve to your IP address. Whether your web server would send a 404 or not depends on the server config. (E.g., Apache is often configured with a default name vhost which it'll serve the request with). – derobert Jul 09 '17 at 17:47
  • Ah. Thank you. I now understand domain name resolution more properly.Will mark my question answered. – bitofagoob Jul 09 '17 at 17:49