linux增加域名代替ip
1、查看当前的域名配置列表
cat /etc/hosts
2、配置域名
vi /etc/hosts
/etc/hosts:
192.168.0.10为当前服务器ip
192.168.0.20为配置其他服务ip
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.10 appServer10
192.168.0.20 dbserver20
标签:ip,192.168,etc,域名,linux,localhost
From: https://www.cnblogs.com/lgxdev/p/17999842