You are not logged in.

#1 2016-05-27 16:42:37

Talster
Member
Registered: 2016-05-18
Posts: 23

Can go to websites, but the terminal can't ping hostnames

Hey, same guy from https://bbs.archlinux.org/viewtopic.php?id=212937

My Linux was working perfectly for a while after that solution in the post, however, pacman stopped working. Can't resolve hosts! But, when I go to those hosts via Firefox, it pulls up perfectly fine!

I am using netctl to manage my connections, but I disabled them and am currently using a wired connection instead, for the time being.

I don't know what extra data to give. I do have one file, though. My /etc/resolv.conf has a small complaint listed in the code below.

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888
# Too many DNS servers configured, the following entries may be ignored.
nameserver 2001:4860:4860::8844

I'm a bit confused about why I can connect to google.com on Firefox without a single delay, yet pinging google.com gives me [Name or service not known].

Any ideas?

Offline

#2 2016-05-27 18:14:17

GuloGuloDesu
Member
Registered: 2013-07-18
Posts: 35

Re: Can go to websites, but the terminal can't ping hostnames

Are you able to

dig www.google.com

Just curious if it is just a problem with ping.

Also, do you have a hostname set?

hostname -fqdn

Offline

#3 2016-05-27 18:25:28

Talster
Member
Registered: 2016-05-18
Posts: 23

Re: Can go to websites, but the terminal can't ping hostnames

GuloGuloDesu wrote:

Are you able to

dig www.google.com

Just curious if it is just a problem with ping.

Also, do you have a hostname set?

hostname -fqdn

I do not have the dig command on my computer. My hostname is set, although

 hostname - fqdn

only resulted in a

 invalid option -- 'q' 

I don't know if it's a problem with ping, since even pacman has trouble with resolving host names.

Offline

#4 2016-05-27 18:36:50

GuloGuloDesu
Member
Registered: 2013-07-18
Posts: 35

Re: Can go to websites, but the terminal can't ping hostnames

Try

nslookup www.google.com

That is the old way of checking name resolution.

Offline

#5 2016-05-27 18:45:17

Talster
Member
Registered: 2016-05-18
Posts: 23

Re: Can go to websites, but the terminal can't ping hostnames

GuloGuloDesu wrote:

Try

nslookup www.google.com

That is the old way of checking name resolution.

Command not found.

How many important packages must I have missed out on? hmm

Offline

#6 2016-05-27 19:16:17

netadmin
Member
Registered: 2016-04-28
Posts: 45

Re: Can go to websites, but the terminal can't ping hostnames

You need to install dnsutils to use nslookup

pacman -S dnsutils

Offline

#7 2016-05-27 19:18:52

netadmin
Member
Registered: 2016-04-28
Posts: 45

Re: Can go to websites, but the terminal can't ping hostnames

Talster wrote:

I do not have the dig command on my computer. My hostname is set, although

 hostname - fqdn

only resulted in a

 invalid option -- 'q' 

missing second dash try this

 hostname --fqdn

Offline

#8 2016-05-27 19:26:38

Talster
Member
Registered: 2016-05-18
Posts: 23

Re: Can go to websites, but the terminal can't ping hostnames

netadmin wrote:
Talster wrote:

I do not have the dig command on my computer. My hostname is set, although

 hostname - fqdn

only resulted in a

 invalid option -- 'q' 

missing second dash try this

 hostname --fqdn

That did the trick.

localhost.localdomain

is the result.

Offline

#9 2016-05-27 19:29:26

Talster
Member
Registered: 2016-05-18
Posts: 23

Re: Can go to websites, but the terminal can't ping hostnames

netadmin wrote:

You need to install dnsutils to use nslookup

pacman -S dnsutils

pacman still can't resolve hosts hmm

Offline

#10 2016-05-27 19:38:23

netadmin
Member
Registered: 2016-04-28
Posts: 45

Re: Can go to websites, but the terminal can't ping hostnames

Talster wrote:

pacman still can't resolve hosts hmm

lol. Lets see if you have drill

Try

drill www.google.com

and if nothing try

drill @8.8.8.8 www.google.com

Offline

#11 2016-05-27 20:27:14

Talster
Member
Registered: 2016-05-18
Posts: 23

Re: Can go to websites, but the terminal can't ping hostnames

netadmin wrote:
Talster wrote:

pacman still can't resolve hosts hmm

lol. Lets see if you have drill

Try

drill www.google.com

and if nothing try

drill @8.8.8.8 www.google.com

Nope, no drill either! I need a list of necessary packages after this tongue

Offline

#12 2016-05-27 20:29:32

netadmin
Member
Registered: 2016-04-28
Posts: 45

Re: Can go to websites, but the terminal can't ping hostnames

Per the other thread are you still using systemd-resolved service and /run/systemd/resolve/resolv.conf ? I see you had everything working based on what Head_on_a_Stick recommended.

Offline

#13 2016-05-27 20:52:53

Talster
Member
Registered: 2016-05-18
Posts: 23

Re: Can go to websites, but the terminal can't ping hostnames

netadmin wrote:

Per the other thread are you still using systemd-resolved service and /run/systemd/resolve/resolv.conf ? I see you had everything working based on what Head_on_a_Stick recommended.

Yes, but through user error my resolved.conf is gone. It'll be automatically regenerated, correct?

Pinging IP addresses works perfectly fine, however, host names do not.

Offline

#14 2016-05-27 21:18:11

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Can go to websites, but the terminal can't ping hostnames

Talster wrote:

through user error my resolved.conf is gone. It'll be automatically regenerated, correct?

No, the file at /run/systemd/resolve/resolv.conf is auto-generated but if you delete the symlink at /etc/resolv.conf then that will not be re-created.

Run the `ln` command again, check the success with:

ls -l /etc/resolv.conf

Jin, Jîyan, Azadî

Offline

#15 2016-05-27 21:50:08

Talster
Member
Registered: 2016-05-18
Posts: 23

Re: Can go to websites, but the terminal can't ping hostnames

Head_on_a_Stick wrote:
Talster wrote:

through user error my resolved.conf is gone. It'll be automatically regenerated, correct?

No, the file at /run/systemd/resolve/resolv.conf is auto-generated but if you delete the symlink at /etc/resolv.conf then that will not be re-created.

Run the `ln` command again, check the success with:

ls -l /etc/resolv.conf

After running the last command, it printed this:

lrwxrwxrwx 1 root root 32 May 27 17:48 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf

Offline

Board footer

Powered by FluxBB