Follow the below steps to Change localhost to custom domain name in XAMP server. 1) Open the file C:\Windows\System32\drivers\etc and “Copy hosts file to desktop” and open it. Current hosts file will looks like this, Add the below line and save the file. Copy host file and replace with existing one in C:\Windows\System32\drivers\etc. 2) Edit