Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Cannot ping google but can ping 8.8.8.8
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
curiousdoge
n00b
n00b


Joined: 30 Apr 2017
Posts: 5

PostPosted: Sun Apr 30, 2017 2:42 pm    Post subject: [SOLVED]Cannot ping google but can ping 8.8.8.8 Reply with quote

Hi, I'm quite new to gentoo and I've managed to install gentoo. I've had issues about getting the internet to work without the liveCD and managed to get it to work by emerging wpa_supplicant. I've also emerged NetworkManger but after that my internet is no longer working properly. When I run NetworkManager I have no connection to the internet so I stopped it and tried to use wpa_supplicant again, which worked but I can no longer ping google.com . However I can ping IPs like 8.8.8.8 or 192.168.1.1 just fine.

I've googled the problem and many solutions have to do with editing the /etc/resolv.conf file, however this file doesn't exist for me anymore.
Any help would appericated.


Last edited by curiousdoge on Tue May 02, 2017 10:58 am; edited 1 time in total
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Sun Apr 30, 2017 2:51 pm    Post subject: Reply with quote

Another poster recently had trouble with /etc/resolv.conf, but his /etc/resolv.conf was pointing to a non-existent file that was related to a (removed) installation of NetworkManager. The fix for him was to remove /etc/resolv.conf (command = `rm /etc/resolv.conf`), in light of the fact that the tool he was using to register network details (dhcp) creates /etc/resolv.conf, and could not create it over top of the link that NetworkManager installed.

How are you starting your network?
Back to top
View user's profile Send private message
curiousdoge
n00b
n00b


Joined: 30 Apr 2017
Posts: 5

PostPosted: Sun Apr 30, 2017 2:59 pm    Post subject: Reply with quote

I've haven't removed NetworkManager but just did so now. I also removed the /etc/resolv.conf file.
How would I go about creating a new resolv.conf file?
My network starts automatically on boot, I believe by starting wpa_supplicant and my interface.
Thanks for helping!
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Sun Apr 30, 2017 3:08 pm    Post subject: Reply with quote

You don't create a new /etc/resolv.conf file. Just start the network, the network makes a new one for you. Assuming that you have configured your network interface to use dhcp, which is the default and most common arrangement. The fact that you can view the network says that the interface is up, and the fact that you can't "view/ping by name" but can "view/ping by IP address" is a symptom of no DNS lookup.

The IP address (it is ALWAYS a number) that will be used for DNS lookup is sent to you by your dhcp-provider, maybe your router is performing that function, maybe another computer on your network. The IP address (always a number) that will be used for DNS lookup is stored in /etc/resolv.conf.

Oh, when your network starts automatically at boot, if likely gives some sort of message. Here I get "Bringing up interface [interfacename]" I don't have to reboot to restart that interface name.

The exact method of restarting a network interface depends on the system you are using for booting. I use openrc. Some people use systemd. I will be of no help if you are booting with systemd, because I deliberately keep myself ignorant of systemd's way of working.

If you use openrc, the way to restart an interface is to run "/etc/init.d/net.[interfacename] restart" Typical interfacenames are "eth0", "wlan0" or nowadays some sort of weird assignment. At any rate, I suspect you know the interfacename you are working with.


Last edited by cboldt on Sun Apr 30, 2017 3:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42860
Location: 56N 3W

PostPosted: Sun Apr 30, 2017 3:10 pm    Post subject: Reply with quote

curiousdoge,

dhcpcd may create /etc/resolv.conf for you.

It needs to contain at least one line of the form
Code:
nameserver <IP_of_nameserver>

If you create it by hand, because dhcpcd didn't, it will be removed when your dhcpch lease expires
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42860
Location: 56N 3W

PostPosted: Sun Apr 30, 2017 3:14 pm    Post subject: Reply with quote

cboldt,

As long as you allow hex as numbers, yes.
/etc/resolv.conf:
nameserver 213.133.x.y
nameserver 2a01:4f8:0:a0a1::

Entries redacted.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
curiousdoge
n00b
n00b


Joined: 30 Apr 2017
Posts: 5

PostPosted: Sun Apr 30, 2017 3:41 pm    Post subject: Reply with quote

I've managed to to fix the issue by using the liveCD and chrooting and remaking the /etc/resolv.conf there using net-setup. I can ping google.com again!
Interesting note, dhcpcd never works without the liveCD, it always times out.

Anyways, thanks for all your help.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1694

PostPosted: Sun Apr 30, 2017 3:52 pm    Post subject: Reply with quote

When you boot your computer normally, check to see what ip address it has. If the ip address is something than the 169.x.x.x (trash address), then the system already called dhcpd for you. The most common issue that people have is trying to call dhcpd on an interface that is already up using dhcpd. The livecd works, because the interfaces are usually not started right away.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7041
Location: Saint Amant, Acadiana

PostPosted: Sun Apr 30, 2017 3:59 pm    Post subject: Reply with quote

curiousdoge wrote:
I've managed to to fix the issue by using the liveCD and chrooting and remaking the /etc/resolv.conf there using net-setup. I can ping google.com again!
Interesting note, dhcpcd never works without the liveCD, it always times out.

Anyways, thanks for all your help.


That was the hard way ... instead of creating the file and following Neddy's suggestion.

Code:
echo 'nameserver <IP_of_nameserver>' > /etc/resolv.conf


^^
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum