让域名解析到ip,测试搭建环境

4.网站更新过程(程序代码更新)
(1)在开发人员自己电脑进行测试
(2)公司内部机房进行测试
(3)在IDC机房(数据中心) 测试
(4)程序代码放在用户使用的环境(生产环境/线上环境)

  1. /etc/hosts
    [root@huahua ~]# vi /etc/hosts //让域名解析到ip,测试搭建环境
    [root@huahua ~]# cat /etc/hosts
    127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
    192.168.10.70 huahua.com jd.com //地址一定是本机地址 ,一定不能写baidu.com,因为ping百度就等于ping自己
    [root@huahua ~]# ping jd.com //ping jd.com,能ping通
    PING huahua.com (192.168.10.70) 56(84) bytes of data.
    64 bytes from huahua.com (192.168.10.70): icmp_seq=1 ttl=64 time=0.125 ms
    64 bytes from huahua.com (192.168.10.70): icmp_seq=2 ttl=64 time=0.114 ms
    64 bytes from huahua.com (192.168.10.70): icmp_seq=3 ttl=64 time=0.116 ms
    ^C
    --- huahua.com ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 1999ms
    rtt min/avg/max/mdev = 0.114/0.118/0.125/0.010 ms
    [root@huahua ~]# ping huahua.com //ping huahua.com,能ping通
    PING huahua.com (192.168.10.70) 56(84) bytes of data.
    64 bytes from huahua.com (192.168.10.70): icmp_seq=1 ttl=64 time=0.081 ms
    64 bytes from huahua.com (192.168.10.70): icmp_seq=2 ttl=64 time=0.170 ms
    64 bytes from huahua.com (192.168.10.70): icmp_seq=3 ttl=64 time=0.118 ms
    ^C
    --- huahua.com ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2000ms
    rtt min/avg/max/mdev = 0.081/0.123/0.170/0.036 ms

你可能感兴趣的:(让域名解析到ip,测试搭建环境)