Configuring add-on domains

I have tried Googling this but I’m afraid I don’t understand the next step ie how to set things up so that when someone enters nananap.tk in their server they will get my site.

I have a domain name (lets call it mydomain.co.uk) that I got with another company that I use to “point to” web space on a server with yet another company. I have an index.php page on mydomain.co.uk/nananap/index.php. So what do I need to do, where, to get it so that nananap.tk/index.php opens that page? I still want mydomain.co.uk to access the other content on this server.

I hope I have explained things OK. I have some understanding of html and php and things but know very little about domains and nameservers and DNS and so on.

Thank you.

Unfortunately quite involved and do not know how your server is managed :frowning:

For my VPS Linux webhosting…

Freenom has a domain setting which needs two or three settings changed to point your domain to my server hosting.

NS1.CONTABO.NET
NS2.CONTABO.NET
NS3.CONTABO.NET

ON my VPS I have to setup a config file

/etc/apache2/sites-available/nana pop.tk.conf

The conf file has servings for domain name, directory location, error log file name, etc

Command Box prompt :slight_smile:

a2ensite nanapop.tk
systemctl restart apache2

Create the directory set in the conf file:

/var/www/nananpop.tk/public_html/index.html

Apache2 needs installing:

sudo apt install apache2
systemctl restart Apache2

Php and MySQL may need installing…

1 Like

Mine is managed via cPanel.

Freenom needs the domains pointing at your server hosting:

Freenom → Services → Manage Domains → Management Tools → Nameservers
Name server1 = NS1.YOUR_SERVER_NAME.TLD
Name server2 = NS2.YOUR_SERVER_NAME.TLD
Name server3 = NS3.YOUR_SERVER_NAME.TLD
Select → Change Nameservers

That shuld take upto about 48 hours to propagate:

Mine is nearly finished propagating:

https://www.whatsmydns.net/#A/jbtest.tk

I believe CPANEL is a lot easier to set your domain on your server, i Have forgotten how to use it since it was over ten years since last used.

1 Like

I have changed the name servers as described - thank you. So when that finishes propagating does that mean that nananap.tk will open the index.html in the public_html folder of my server? I am a little confused because I already have another domain pointing there (danieljeffery.co.uk). How will I get danieljeffery.co.uk to open one page but nananap.tk to open another?

(thank you for giving me the confidence to persist with this).

That depends on the server. You need to refer to the documentation provided by the server.

1 Like

Thank you.

For the benefit of anyone else finding this in the future what I needed to do was to add an “addon domain”.

Unfortunately I only get to have two of those on the cheap package I am currently using.

Does CPanel and/or your web hosting allow for subdomains Wiki?

Remember that https://www.nanapop.tk is an entirely separate domain from https://nanapop.tk and each can point to different webpage contents!

Also to consider is that Tiny or Short URLs Wiki not only shorten long URLs but also obfuscate SEO pages!

Edit:

I forgot to mention the dynamic webpage content search.

Yes, I am allowed an infinite number of subdomains. But I don’t think you can map them (or whatever the correct term is) to a domain. They have to take the form SOMETHING.danieljeffery.co.uk.

I didn’t know that. In fact I am now even more confused. Both nananap.tk and www.nananap.tk open the same page.

I don’t think so. I have never seen any ability to register a www subdomain separately. www.nanapop.tk and nanapop.tk are the same domain names. You can say they are separate applications, websites, computers or IP addresses but not separate domains.

With Ubuntu Linux the domain name and directory are set in a configuration file and usually the www subdomain is set as an alias:

Configuration file:

/etc/apache2/Sites-available/this-is-a-test-to-see-if-it-works.tk.conf

<VirtualHost *:80>
  ServerAdmin admind@this-is-a-test-to-see-if-it-works.tk
  ServerName this-is-a-test-to-see-if-it-works.tk
  ServerAlias www.this-is-a-test-to-see-if-it-works.tk
  DocumentRoot /var/www/this-is-a-test-to-see-if-it-works.tk/public_html
 
 <Directory /var/www/this-is-a-test-to-see-if-it-works.tk/public_html/>
   Options +FollowSymlinks
 </Directory>

  # Error Logging	
		LogLevel warn
		ErrorLog ${APACHE_LOG_DIR}/error-this-is-a-test.log
		CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

The domain is activated by the Command

a2ensite this-is-a-test-to-see-if-it-works.tk.

As you can see the alias could be omitted and a separate www domain configured. I cannot think of why this option could be useful, far better to have a subdomain with a meaningful name?

1 Like

I am saying that it is not possible to register (have separate owners) this-is-a-test-to-see-if-it-works.tk separately from www.this-is-a-test-to-see-if-it-works.tk. this-is-a-test-to-see-if-it-works.tk is the domain name and www.this-is-a-test-to-see-if-it-works.tk is a subdomain of it. When the Domain Name Service (DNS) resolves www.this-is-a-test-to-see-if-it-works.tk it uses the same registration configuration (file) as it does for this-is-a-test-to-see-if-it-works.tk. Within that registration configuration there can be a different IP address for subdomains.

I’ve had a chance to test and set the following two separate domains:

https://this-is-a-test-to-see-if-it-works.tk/

https://www.this-is-a-test-to-see-if-it-works.tk/

Also to be noted:

I think the Domain Name Service (DNS) never ever resolves www.this-is-a-test-to-see-if-it-works.tk because it is prefixed with www. which makes it a subdomain of this-is-a-test-to-see-if-it-works.tk

The Domain Name Service (DNS) only ever registers the main domain name. The domain name and every subdomain all propagate to the same URI (178.18.246.168). Apache2 receives the relevant URL and redirects to the relevant $_SESSION[‘DOCUMENT_ROOT’] which must have been been previously added and activated, etc to the /etc/apache2/sites-available/ directory.

Today’s Ponderism

What can I do with the completely separate www. domain? A-B Testing?