Меню Рубрики

Linux ping name or service not known

ping: http://google.com: Name or service not known

I’m using centos7 in virtualbox on windows. And vagrant made it, got ping error with http or https. also curl. someone can help me how to fix it and let it work.

network file automatically created from vagrant

4 Answers 4

ping has nothing to do with HTTP or HTTPS:

Ping will use ICMP protocol, it belongs to TCP/IP

Ping operates by sending Internet Control Message Protocol (ICMP) echo request packets to the target host and waiting for an ICMP response.

Actually ping works at a much lower level than HTTP or HTTPS, and only accepts hostnames, not URLs.

First make sure you have your network adapter enabled in virtual box settings.

Your network interface which you use it for connecting to internet might not be active.

To check this,use «sudo nmcli d» command.

If it is disconnected,use «sudo nmtui«->Edit a connection,select your network interface and choose «Automatically connect» option(by pressing Space key) and select OK.

Источник

ping displays “Name or service not known”

I am running Arch Linux on a Raspberry Pi.

  1. I am unable to ping to a website.
  2. I am unable to access a website from the browser.

I have two more computers (all running Arch Linux) connected to the Internet, where I can ping and use the Internet. Also, /etc/resolv.conf is identical on the other computers:

I can use VNC. I can also ping to 8.8.8.8. When trying to access DuckDuckGo on Chromium I get:

I have an active Internet connection. What’s wrong?

3 Answers 3

Although I’ve never had problem with my other x86_64 PC all running Arch Linux, this frequently happens till date with Arch Linux ARM when running NetworkManager.

The problem is like you are connected to wifi, but you can’t ping or use the internet but you can access all the computers on the local network, and even use remote desktop sharing software.

There is a high chance that something went wrong while your ping or your browser tries to resolve the host. I can think of 3 solutions:

Solution 1

I believe this is a problem on the thousands of the Raspberry Pi systems running Archlinux ARM and using NetworkManger.

In my case /etc/resolv.conf was a broken symlink to ../run/systemd/resolve/stub-resolv.conf .

NetworkManager can’t populate the symlink, and the /etc/resolv.conf is empty. We have to:

  1. Remove the broken symlink:
  1. Create an /etc/NetworkManager/conf.d/dns.conf file with the contents:
  1. Restart NetworkManager:

This should fix the issue, if not follow Solution 2.

Solution 2

In case the above didn’t fix the issue for you, you can temporarily populate /etc/resolv.conf by:

The reason this works is because probably something is messing up the /etc/resolv.conf file. The above command should overwrite the contents, but again, you should look at what causing the issue.

Solution 3

If you can’t get your /etc/resolv.conf back, just create a new /etc/resolv.conf (delete if an empty old one or symbolic link exists) and paste the code:

Note, in the first line, you can also use your router’s IP address, for example ( nameserver 192.168.43.1 in my case) which will make other systems pingable on the same network. It’s not a good idea to generate resolv like this, but I had a bad time with the NetworkManager’s auto-generated resolv. Systemd-resolvd also generates wrong ones, even on my PC.

A bit weird, here I am using google’s primary dns and cloudflare’s primary dns, you can use 8.8.8.8 with 8.8.4.4 or 1.1.1.1 with 1.0.0.1.

Although that step works, but you may want to stop NetworkManager from overwriting the file whenever it restarts:

Add this entry to /etc/NetworkManager/NetworkManager.conf

They worked for my installations on Raspberry Pi 3 model B. Hope this will work for you, too.

Источник

Arch Linux

You are not logged in.

#1 2018-01-06 20:44:52

[SOLVED]ping: google.de: Name or service not known

I am a total newbie to Arch Linux, having switched from Debian 9 and Centos7 to ArchLinux. Today I wanted to install Arch Linux on Virtual Box running on a Windows8 computer.
In my VirtualBox settings I left «NETWORK» to NAT, left «ACTIVATE NETWORK ADAPTER» and «CABLE CONNECTED» checked.

Then I booted ArchLinux installer from CD in VirtualBox and did the following:

I am connected from guest (ArchLinuxVM) to host(Windows8) via NAT and from Windows 8 to my Fritz.Box-Router via ethernet patch cable.
The IP address of my router is 192.168.178.1. I tried to change it to 10.0.2.1 but this is not possible.

Why can’t the ArchLinuxVM reach the internet over my router?
The windows 8 can reach the internet and the Arch VM can ping anyone in the Local Area Network.

Any suggestions/help? The Arch Wiki did not help me in this case because it only covers WLAN connection issues.

output: [samp]»dhcpcd already running on pid 493 (/run/dhcpcd-enp0s3.pid)

output: #Generated by resolvconf
domain fritz.box
nameserver 192.168.178.1
So Arch knows his DNS! Makes sense, otherwise I couldn’t reach other hosts in my LAN, right?

Last edited by intimothy (2018-01-06 21:43:50)

#2 2018-01-06 20:50:12

Re: [SOLVED]ping: google.de: Name or service not known

The windows 8 can reach the internet and the Arch VM can ping anyone in the Local Area Network.

Does this include being able to ping 192.168.178.1?
What is the output of `ip r`?

Online

#3 2018-01-06 20:53:03

Re: [SOLVED]ping: google.de: Name or service not known

Does it work if you use bridged rather than NAT in the VBox settings?

No, it didn’t «fix» anything. It just shifted the brokeness one space to the right. — jasonwryan
Closing — for deletion; Banning — for muppetry. — jasonwryan

#4 2018-01-06 20:54:23

Re: [SOLVED]ping: google.de: Name or service not known

Does this include being able to ping 192.168.178.1?

yes. It might be NAT Service instead of NAT, otherwise I wouldn’t be able to reach other hosts except for the router, right?

What is the output of `ip r`?

default via 10.0.2.2 dev enp0s3 src 10.0.2.15 metric 202
10.0.2.0./24 dev enp0s3 proto kernel scope link src 10.0.2.15 metric 202

#5 2018-01-06 20:57:04

Re: [SOLVED]ping: google.de: Name or service not known

Does it work if you use bridged rather than NAT in the VBox settings?

I haven’t tried that yet because it has got to be working with NAT.

#6 2018-01-06 21:03:25

Re: [SOLVED]ping: google.de: Name or service not known

I believe that «NAT» in VirtualBox actually means «NAT Service» and «NAT-Network» is the actual NAT.
Otherwise I wouldn’t be able to ping my raspberrypi from the ArchLinux guest but only my router.

#7 2018-01-06 21:06:38

Re: [SOLVED]ping: google.de: Name or service not known

Does this include being able to ping 192.168.178.1?

yes. It might be NAT Service instead of NAT, otherwise I wouldn’t be able to reach other hosts except for the router, right?

Not exactly your system appears to be using NAT twice once on the Windows vmware host and secondly on the router.
Arch guest has IP 192.168.178.1 which should be translated to the IP of the router facing interface on the Windows host which the router will then translate to the IP of its internet facing interface.
You might have been able to only ping the Windows host but not the router which is what I was checking.
If your Windows box is not doing NAT for the arch guest then it would need to be doing routing to send 192.168.* to 10.* and route back the returns.
Edit:
fix quoting
Edit2:
clarify first NAT was on the Windows host.

Last edited by loqs (2018-01-06 21:09:55)

Online

#8 2018-01-06 21:12:11

Re: [SOLVED]ping: google.de: Name or service not known

Does it work if you use bridged rather than NAT in the VBox settings?

I haven’t tried that yet because it has got to be working with NAT.

Yes, it is actually working with bridged networking. But why does he not find his correct dhcp server (192.168.178.1) when I do NAT?

default via 192.168.178.1 dev enp0s3 src 192.168.178.23 metric 202
192.168.178.0/24 dev enp0s3 proto kernel scope link src 192.168.178.23 metric 202

Why did it not work via NAT? I didn’t change anything in the NETWORK-tab in VirtualBox (default was NAT, not NAT NETWORK!)
I’ll figure this out, apparently I have too little knowledge about VirtualBox. (version 5.1.26 (Qt5.6.2))

Источник

ping: : Name or service not known — while pinging a valid ip

Well, This appears to be a known issue to many but I’ve applied many of the workarounds I found online but none of them worked!

I’m running packer from a docker container to build an image on openstack. I could get the ip address of the instance but couldn’t ping/ssh/execute ansible within packer provisioners.

All of them fail with this error:

openstack: ping: 172.30.16.165: Name or service not known

Funny thing is I could ping the same ip from other machines and the docker container executing packer. So, not sure why the packer provisioner couldn’t do. DNS & network settings of the host & docker container are all same.

Also, I could connect to other floating ips on the same openstack tenant. I’m using floating-ip-network to assign to an external ip to connect to the instance at a later point.

I did add the ip to /etc/hosts file but it didn’t fix the issue. If someone could help me with this, it would be really great.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Samsung smart view для mac os
  • Samsung scx 4200 драйвер mac os
  • Samsung scx 4200 mac os x driver
  • Samsung ml 1610 драйвер mac os
  • Samsung magician для mac os