LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-26-2014, 10:54 PM   #1
caek$
LQ Newbie
 
Registered: Jul 2013
Posts: 7

Rep: Reputation: Disabled
Question Can connect to 74.125.239.39 but not google.com


I'm on Lubuntu and trying to connect to the internet by sharing my connection from my macbook to my linux machine.

Whenever I try to ping to google.com its unresponsive, but when I type "ping 74.125.239.39" in the terminal, it works fine. Same problem in firefox.

Thanks
 
Old 10-26-2014, 11:28 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Your DNS is not working. Did you set up the network connection on Lubuntu with a static IP or DHCP?

What if you run
Code:
sudo echo 8.8.8.8 >> /etc/resolv.conf
and try again?
 
Old 10-27-2014, 07:54 AM   #3
caek$
LQ Newbie
 
Registered: Jul 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
Your DNS is not working. Did you set up the network connection on Lubuntu with a static IP or DHCP?

What if you run
Code:
sudo echo 8.8.8.8 >> /etc/resolv.conf
and try again?
Heres what I got:
Code:
sudo echo 8.8.8.8 >> /etc/resolv.conf
Code:
bash: /etc/resolv.conf: Permission denied
I'm not completely sure, on my network settings my IPv4 settings are automatic (DHCP) and my IPv6 settings are automatic (address only)
 
Old 10-27-2014, 02:40 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i also get that permission denied error.

if i type "su" first, i can enter the command. i guess it has to do with the ">>".

but i think if you already have 2 nameservers in resolv.conf, appending a 3rd will not help?

so maybe you should:
Code:
$ su
# mv /etc/resolv.conf /etc/resolv.conf.bak
# echo 8.8.8.8 > /etc/resolv.conf
#
if that gives you a working internet connection, we are one step further, but your problem is not solved yet.
 
Old 10-27-2014, 03:30 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by ondoho View Post
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.
 
Old 10-27-2014, 10:58 PM   #6
caek$
LQ Newbie
 
Registered: Jul 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
i also get that permission denied error.

if i type "su" first, i can enter the command. i guess it has to do with the ">>".

but i think if you already have 2 nameservers in resolv.conf, appending a 3rd will not help?

so maybe you should:
Code:
$ su
# mv /etc/resolv.conf /etc/resolv.conf.bak
# echo 8.8.8.8 > /etc/resolv.conf
#
if that gives you a working internet connection, we are one step further, but your problem is not solved yet.
I tried
Code:
sudo su
Because without it I would get an authentication failure.
So now I'm in root and I typed the following, according to your instructions
Code:
mv /etc/resolv.conf /etc/resolv.conf.bak
echo 8.8.8.8 > /etc/resolv.conf
and the output was nothing, so I guess its successful?

Quote:
Originally Posted by suicidaleggroll View Post
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 View Post
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.

Last edited by caek$; 10-27-2014 at 11:02 PM.
 
Old 10-28-2014, 02:51 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by caek$ View Post
and the output was nothing, so I guess its successful?
yes.
but do you get a working internet connection with that?
 
  


Reply

Tags
ip, network



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] --current, pidgin can't connect to google talk or google via xmpp Old_Fogie Slackware 3 04-16-2011 01:56 PM
My dlink dwa-125 won't let me connect to the internet Belton222 Linux - Newbie 6 03-20-2011 02:03 PM
dl-close.c:239: _dl_close: Assertion `new_opencount[0] == 0' yakotey Programming 2 01-05-2006 06:42 AM
connect to google bruse Linux - Newbie 11 07-22-2005 07:44 AM
Casio E-125 gax1985 Linux - Laptop and Netbook 1 09-19-2004 10:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration