Labs - DNS server

Question 5
On host01 point www.google.com to 127.0.0.1 IP address locally.

error
cat >> /etc/hosts
bash: /etc/hosts: Permission denied
thor@host01 /$ sudo cat >> /etc/hosts
bash: /etc/hosts: Permission denied

Its happening in all the topics in DNS labs here it says permission denied when i try to edit this file. in question 6 and question 9.

what am i doing wrong?

You have to add sudo to the command as below :


Sudo (sometimes considered as short for S uper- u ser do ) is a program designed to let system administrators allow some users to execute some commands as root (or another user). The basic philosophy is to give as few privileges as possible but still allow people to get their work done.

sudo does not work in this instance with the cat command, if you had read the user’s post you would understand that.

The example in the video proceeding it used cat, why would we be expected to use vi all of a sudden? Also an explanation of why cat doesn’t work in this instance would be helpful, instead of flip response.

If you would like to run cat command to display file contents. Then process
sudo cat /etc/hosts