DNS是域名解析,被注释掉了的话就不能解析域名了,给你看看域名解析的相关配置了解一下:
root@jaking-virtual-machine:~# cat /etc/resolv.conf# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
search localdomain
更多知识请百度《Linux就该这么学》
1、使用grep -v "^#" 来去掉注释行,其中:-v 就是取相反的 ^# 表示以#开头的行eg. grep -v "^#" /etc/vsftpd/vsftpd.conf (也可以使用“>”来重写配置文件)
2、有时也会连同空行一起去掉,使用管道符来完成(^$表示空行 )
eg. grep -v "^#" httpd.conf | grep -v "^$" >>vsftpd.conf
上面用了 2次 grep 过滤命令 ,也就是把空行和注解行过滤掉,再把剩下的内容追加保存为原
来的配置文件 vsftpd.conf 这个时候就文件里的内容就没有注解行和空行了,,,,
3、备注:在更改配置文件时,建议先对配置文件做一下备份,对配置文件不熟悉的建议不要用这种方法,配置文件中的注解行还是有一定的帮助的。
cp -a httpd.conf httpd.conf.bak
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)