Could someone explain to me the process of adding a hostname? (hostname.domain.com)
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Could someone explain to me the process of adding a hostname? (hostname.domain.com)
What do I have to do to add a hostname? For example I have foobar.com and would also like to have media.foobar.com.
Do I just mess with some files on the server? Or do I need to mess with the nameservers? Or even some settings with the "domain company" it self?
Without knowing how to do it I'm imagining that if I want media.foobar.com to be created and directed to <ipaddress>:81 I just add to /etc/hosts: "<ipaddress>:81 media.foobar.com", with "<ipaddress> foobar.user.openhosting.com foobar localhost" already present.
The hosting and the domain are not with the same company.
You need an A (or AAAA for IPv6) record in the DNS zone file for the domain. So it is the nameserver, yes. If someone else is hosting your DNS, they might have a web interface that will allow you to make the necessary changes (GoDaddy has this, for example).
I believe you need to talk with your hosting vendor and ask them for it. I've done several times and usually there is a web interface that will allow you to add subdomains.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.