I recently purchased a VPS from a service. The hostname seems semi randomly generated
12jk34kd.vpsservice.example
It says I have the option to change the hostname but it looks like I can change the entire thing. As far as I understood, the hostname in this case is
12jk34kd
while the domain is
vpsservice.example
if I change the entire thing to
myserver.example.com
- I assume I need to own the domain
example.com
and have it pointing to the VPS server? - To point a domain to the server, do I change the Nameservers of the domain or do I change the DNS Servers on the VPS? Or both?
Also, is the main advantage simply that I can use the hostname over the IP address to connect to the server?
i.e.
ssh user@192.0.2.12
becomes
ssh user@hostname.example.com
And if 3 is correct, if no other services use the server (database etc) and I login via ssh using the IP, is changing the server to use your own domain instead of its default domain really even needed?
hostname example.com
in command line and it would set the hostname to anything you enter. That being said there are some tools ive found that will have long delays due to a failing host name lookup so it should be resolvable.