I have bought a domain, let's call it example.net. I am setting up a CentOS 6 home server with CentOS Web-Panel. I am planning to host at least one site from this domain, possible 2 if I can use sub-domains like sub.example.net.

Question 1:
What should be my CentOS 6 server hostname?

I create a zone in the DNS manager. Options I fill are Zone/Domain: example.net and I also fill my xxx.xxx.xxx.xxx public IP of the server to the Web Server IP option. Primary NS and Secondary NS are ns1.centos-webpanel.com.

Question 2:
I am kind of confused about how this works. Do I put these 2 NS on my domain registrar to point to my site? And what are these 2 NS? Are they freely given to me by the WebPanel DNS service?

Question 3:
If I want to create a sub-domain, what do I do?

  • I want to be careful. The hostname of a computer should not be confused with a domain name or even a sub-domain name. Most *nix installs will appear to want to use the hostname as a sub-domain of a parent domain, however, I remind you that these things are not the same and do not matter. Use a host name that means something to you. You do not have to assign a domain name during install. As far as the Internet and DNS is concerned, use the domain name that you have and any sub-domain you want in your DNS. Neither have to match the hostname. – closetnoc May 6 '16 at 12:12
  • 1
    For example, you can have a hostname of myreallyreallyfastcomputer and give it a domain name of myreallyreallybogusdomain.com making myreallyreallyfastcomputer.myreallyreallybogusdomain.com. However, in DNS you can use mysub-domain.example.com and create records that makes it available on the Internet. If your web server and other Internet services are configured correctly, myreallyreallyfastcomputer.myreallyreallybogusdomain.com will never show or resolve. It is generally junk information though it can match a real domain name too. – closetnoc May 6 '16 at 12:43
  • Thanks! That was useful. Any chance you can help me understand how the NS work in Question 2? – Syarx May 6 '16 at 13:38
  • I am not sure I understand Q2: However, generally, you do not want to change these. It is always far simpler to manage DNS records within the DNS of your registrar. Registrars have robust DNS/NS systems and better interfaces for managing records. You want to put back the NS records, add an A record for your domain name, a CNAME for www (if you want), an MX record for any e-mail server. That should be it. It is a common misconception that people need to -or- should run their won NS servers. This is generally a very very bad idea. – closetnoc May 6 '16 at 13:57
  • but my registrar gives me only the option to change the nameservers the domain points to ... – Syarx May 6 '16 at 14:23

The hostname of the server is different to the domain name of it. Using my network as an example (because i'm half Greek) the host names are...

  • zeus.domain.lan
  • hera.domain.lan
  • xena.domain.lan

but the domains for my servers on the web are...

  • web117.domain.com
  • web118.domain.com
  • db01.domain.com

Now why it it done this way, well the hostname for the machine is unique within the local network itself and is used for working with the machine on the local network, administration for instance, and can be anything you want, I have actually seen a company that used various swear words for host names, and another that used sexual positions for host names, but of course these would not look at all professional so companies tend to use different names for the DNS records for the internet facing side of the servers.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.