Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
/etc/hostname and /etc/hosts
When I set up a droplet I was “lazy” with naming. Now my hostname is “First.com”. And there are two websites on the server (NGINX).
I want to change hostname from “First.com” to Production. But I am slightly lost since two FQDN are pointing to the same machine.
Should I do as following:
change in /etc/hostname to Production (as from now it was First.com)
(* this one for me is logical *)
change in /etc/hosts:
(now it was 127.0.1.1 First.com)
I am especially lost by this 127.0.1.1 loop-back.
Or should I do:
Or should I just
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×