Quantcast
Channel: `sudo visudo /etc/hosts` gives syntax errors - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2

`sudo visudo /etc/hosts` gives syntax errors

$
0
0

Really dumb question, Ubuntu 20, and I have apache2 installed, not much else.I go sudo visudo /etc/hosts and want to add an alias "dummy.com" domain alias as a hack to point to the server for local only testing a learning site and I get this unusual

>> /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

I removed the 127.0.0.1 localhost notmydomain.com line , so this is my file now, why does it have such syntax errors as above whenever I edit it?

conrad@conrad-VirtualBox:~$ cat /etc/hosts127.0.0.1   localhost127.0.1.1   conrad-VirtualBox# The following lines are desirable for IPv6 capable hosts::1     ip6-localhost ip6-loopbackfe00::0 ip6-localnetff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allrouters

Confused because the browser does work when I visit fakedomain.com (curiously the alias still carries on working in browser even after I removed the fakedomain.com alias and ran sudo service network-manager restart.) I've wasted so much time on this I'm going to re-install, but would love to know where I might have gone wrong.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>