I am new to Ubuntu and I have been researching and doing practice but I couldn't figure out exactly the correct command to help me solve my problem. I would be very grateful if someone could help me out here. I want to know how I could use nano command to add the line "dns-servers" to the /etc/network/interfaces.
2 Answers
You enter the command sudo nano /etc/network/interfaces
.
The reason you have to prepend it with sudo is simply that the system configuration files is only writeable by root; not your everyday user.
When you've made the modifications you can exit nano
by Ctrl+x. You'll be prompted if you want to save your changes. Press y to select Yes. When prompted for filename, simply press enter to save to same filename as you opened.
Nano in addition shows a list of useful keys at the bottom. As per Unix convention ^ is Ctrl, so ^-C is Ctrl+c, whilst M is Alt.
nano
is an text editor.
You can edit the file "/etc/network/interfaces"
with this command
nano /etc/network/interfaces
If you are not logged in as root, you need to type 'sudo' before.
sudo nano /etc/network/interfaces
You can save with CTRL+x
- y
and ENTER
to confirm