Linux中DNS的设置

时间:2023-03-09 09:35:25
Linux中DNS的设置

1.查看本机的域名

hostname

Linux中DNS的设置

2.修改DNS

  临时修改:   

hostname desktop0.example.com

  永久修改:

hostnamectl set-hostname desktop0.example.com

    或者:修改/etc.hostname

vim /etc/hostname

Linux中DNS的设置

3.创建DNS与IP地址的静态映射:

vim /etc/hosts

Linux中DNS的设置

这个是我配置库客户端,服务端可以用同样的方法配置

最后,ping一下服务端:

Linux中DNS的设置