can anyone know how to change domain name of localhost im using apache2 webserver on my localhost i want change domain name localhost to any custom domain
localhost should always be present, on every machine. Because
localhost is the hostname that points to your local machine. On every machine. Always.
What you’re looking for is Virtual hosts combined with DNS. Which can be a bit more trricky than just a hostname change.
But anyway, your hostname can be set with:
sudo hostnamectl set-hostname <hostname>
<hostname> is the hostname you wish to assign to your computer.
I think you rather want to use virtual hosts.
Thanks for the link.