小编Con*_*d B的帖子

`sudo visudo /etc/hosts` 给出语法错误

真是愚蠢的问题,Ubuntu 20,我安装了 apache2,没有太多其他的。我想要sudo visudo /etc/hosts添加一个别名“dummy.com”域别名作为指向服务器的黑客,仅用于本地测试学习网站,我得到了这个不寻常的结果

>> /etc/hosts: syntax error near line 1 <<<
>>> /etc/hosts: syntax error near line 2 <<<
>>> /etc/hosts: syntax error near line 5 <<<
>>> /etc/hosts: syntax error near line 6 <<<
>>> /etc/hosts: syntax error near line 7 <<<
>>> /etc/hosts: syntax error near line 8 <<<
>>> /etc/hosts: syntax error near line 9 <<<
What now? Q
Run Code Online (Sandbox Code Playgroud)

我删除了该127.0.0.1 localhost notmydomain.com行,所以现在这是我的文件,为什么每当我编辑它时它都会出现如上所述的语法错误?

conrad@conrad-VirtualBox:~$ cat /etc/hosts
127.0.0.1   localhost
127.0.1.1   conrad-VirtualBox

# The …
Run Code Online (Sandbox Code Playgroud)

sudo hosts localhost visudo

2
推荐指数
1
解决办法
1944
查看次数

标签 统计

hosts ×1

localhost ×1

sudo ×1

visudo ×1