Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
if i type "su" first, i can enter the command. i guess it has to do with the ">>".
Ah yes you're probably right, it's most likely doing "sudo echo 8.8.8.8" and then piping the output of that to /etc/resolv.conf as the regular user, which won't work.
The ">>" would need to be inside of the sudo command. Probably something like
Code:
sudo "echo 8.8.8.8 >> /etc/resolv.conf"
but since I don't use Ubuntu or any of its derivatives I can't test it here.
The easier way would be to use "sudo -i" to get a real root shell, and then just a simple "echo 8.8.8.8 >> /etc/resolv.conf".
Or disable Ubuntu's stupid "security" policy entirely and switch back to the regular way of doing things with an unprivileged regular user and a separate root user that you switch between with su.
Yes if there are already 2 in resolv.conf, adding a third wouldn't help, but I suspect he doesn't have anything in that file. A simple "cat /etc/resolv.conf" would answer that though.
and the output was nothing, so I guess its successful?
Quote:
Originally Posted by suicidaleggroll
Ah yes you're probably right, it's most likely doing "sudo echo 8.8.8.8" and then piping the output of that to /etc/resolv.conf as the regular user, which won't work.
The ">>" would need to be inside of the sudo command. Probably something like
Code:
sudo "echo 8.8.8.8 >> /etc/resolv.conf"
but since I don't use Ubuntu or any of its derivatives I can't test it here.
I tried
Code:
sudo "echo 8.8.8.8 >> /etc/resolv.conf"
and got "command not found"
Quote:
Originally Posted by suicidaleggroll
The easier way would be to use "sudo -i" to get a real root shell, and then just a simple "echo 8.8.8.8 >> /etc/resolv.conf".
Or disable Ubuntu's stupid "security" policy entirely and switch back to the regular way of doing things with an unprivileged regular user and a separate root user that you switch between with su.
Yes if there are already 2 in resolv.conf, adding a third wouldn't help, but I suspect he doesn't have anything in that file. A simple "cat /etc/resolv.conf" would answer that though.
"echo 8.8.8.8 >> /etc/resolv.conf" works
and "cat /etc/resolv.conf" outputs 8.8.8.8, so I got 8.8.8.8 in that file.
I haven't had success with the DNS serves yet, but thanks for all your guys help so far, I really appreciate it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.