Ubuntu ping есть интернета нет

ping 8.8.8.8 works but ping www.google.com doesn’t

I have tried every «fix» I can find in Ubuntu forums and all over the rest of the internet world and nothing works. The resolv.conf is empty, ifconfig shows nic is functioning, firewall is off, and I threw away the hammer just in case. Unfortunately, I am typing this on another computer on the same network but can’t attach text from the various outputs to show whats going on. Need help on this please.

The resolv.conf file contains these lines:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN search 8.8.8.8 8.8.4.4 

The last line is placed their by the interfaces file when you reboot the system. This is new for 16.04LTS. I’m thinking Windows NT4 wasn’t so bad and neither was Ubuntu Server 12.

How is your system getting it’s IP address? Is it coming from a DHCP server? It is a static IP? Being able to ping the IP address will work without a DNS server IP setup. But it sounds like you don’t have a DNS address setup or your DHCP is not supplying it.

Look at askubuntu.com/questions/143819/… and add your DNS entry for like the Google DNS Servers at 8.8.8.8 and 8.8.4.4

I did all that. My static ip is coming from at&t vdsl box. Im using their dns name-servers and dns-search ip’s. Only thing I can deduce is that at&t is blocking the dns querys.

Interesting. Maybe you might want to contact AT&T and see if they are blocking it in anyway. I guess you could try replacing their DNS servers with the Google DNS servers and see if that works.

7 Answers 7

You need a Name Server in your /etc/resolv.conf file. Edit your /etc/resolv.conf and add a working Name Server. Google provides a free one, 8.8.8.8 .

Place this as the first non-commented line:

You can verify this functionality with:

You can make this change permanent by adding the line to this file your /etc/resolvconf/resolv.conf.d/head file.

Whoopie! Success! excuse me, 36 straight hours banging on this box. It worked. I even put in the at&t ip’s and it worked. Thanks to all you guys for your help and quickness. (Mr. Moderator, these guys needed a pat on the back so ease up on the whole emotionless junk)

Thanks a lot! I couldn’t ping www.google.com after chroot-ing into my ubuntu. Thanks to your solution, now I can do installations etc in the chroot-ed partition.

The marked answer actually doesn’t work on Ubuntu 18.04.01. To fix this issue, here’s what I did:

  • Execute sudo gedit /usr/lib/systemd/resolv.conf
  • Paste nameserver 8.8.8.8 (and/or any other nameserver(s) you want), then save and exit.
  • Add a symlink by executing sudo ln -sf /usr/lib/systemd/resolv.conf /etc/resolv.conf
Читайте также:  Скорость интернета меньше положенной

Could you post a link to the page that told you that file resolv.conf should be empty? My guess is that it is misleading at best.

Edit that file with command sudo nano /etc/resolv.conf and put there a single line:

That should fix your name resolution and the various programs that use it — ping, apt-get, etc.

You also ought to investigate why resolv.conf is empty. Perhaps your DHCP server isn’t configured properly.

This is what the file contains: # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND — YOUR CHANGES WILL BE OVERWRITTEN search 8.8.8.8 8.8.4.4 The last line is placed their by the interfaces file when you reboot the system.

I had the same problem, until I edited with the following values the file 50-cloud-init.yaml

 network: ethernets: eno2: addresses: - 192.168.0.50/24 (my static ip address) dhcp4: false gateway4: 192.168.0.42 nameservers: addresses: [208.67.222.222,208.67.220.220] search: [208.67.222.222] 

hope it works for you too

If is using netplan and Google DNS servers would be addresses: [8.8.8.8,8.8.4.4] (maybe better use Cloudflare’s 1.1.1.1) on /etc/netplan/50-cloud-init.yaml and then sudo netplan —debug apply .

You are facing a problem related to DNS Server that you have specified for you system. Check your nameserver entry in /etc/resolv.conf.

The problem is , ping command is not able to identify what is «www.google.com» because your DNS server is not able to resolve it and provide google actual IP address(every server can only be accessed by its IP address)

Solution

Edit the entry in /etc/resolv.conf . Either provide a correct DNS server of a choice in /etc/resolve.conf that can resolve «www.google.com»

or yYou can specify your local system resolver whose IP address is 127.0.0.53 by adding line

or provide Google’s DNS server IP (any one of them): 8.8.8.8 or 8.8.4.4

P.S You can understand better how DNS works here

Not an good idea on Ubuntu 16.04.x just overwriting /etc/resolv.conf . The OS will overwrite it for its own most likely.

The file /etc/resolv.conf is usually a symbolic link to another file:

ls -lisa /etc/resolv.conf 1310924 0 lrwxrwxrwx 1 root root 29 Jul 13 2016 /etc/resolv.conf -> ../run/resolvconf/resolv.conf 

which means it is correct and you can edit it, but most likely another program is going to overwrite it. I’m going to guess you have NetworkManager installed. To my knowledge this service manages the content of your resolve. So you really should try to setup that one. (On other Hand NetworkManager could be disabled on you system. You might have to tell me.)

Try nmtui and add there the correct DNS Server. I also would use 8.8.8.8 only as secondary DNS. Your primary DNS should be a machine or router nearby your local network or whatever you have there.

Читайте также:  Везде работает интернет кроме ноутбука

No network-manager. Its a server with no gui. I did get dnsutils installed before it quit connecting to the repositories.

@Gary Mercer: how do you bring the network interface then? (ifup and ifdown?) The Network Managers GUI is an optional component. nmtui is the text-based of that one.

I bring the nic up by rebooting the system. Since its a server, it never gets turned «off.» I have found that using restart services doesn’t always work because of the other inter-related components that make up all the services that use the interface. Its just easier and most efficient to restart all the services with a simple reboot command.

By rebooting your system something «a manager» has to bring your devices. In which did you configure the static IP Addresses?

The issue we addressed here is one that boiled down to resolving domain names to an ip address internally. Since version 15 of Ubuntu server, i believe, uses a system of dynamic configuration files that change every time the service or system is restarted or rebooted. If the administrator makes a change to resolv.conf file, those changes are deleted when the resolver service is restarted.

To make changes permanent, Ubuntu has made a way to make user changes permanent without affecting the dynamic configuration of the config files. The suggestion from L.D. James (above) was to add the changes I needed to make to the /etc/resolvconf/resolv.conf.d/head file.

This made the changes permanent and solved the problem of resolving domain names error message host not found . It is the solution to setting the dns nameserver in the interfaces file and then getting it to the resolver as well. Thank you all for your supreme efforts in solving this puzzle.

Источник

Пинг есть, интернета нет

Внезапно пропал интернет на ноутбуке с Ubuntu 14.04. Интернет он получал через Wi-Fi, конфликта IP быть не должно — точнее, может, что-то и было, но теперь я вручную прописал ему и другим устройствам разные адреса. Перезагрузка роутера (говнороутер от Связного, производство Alcatel) не помогает, перезагрузка ноутбука не помогает. Вот приложения, которые точно не видят интернет: Firefox, Synaptic, lynx, aptitude. Но при этом ping ya.ru происходит нормально.

Тем временем другой ноутбук, тоже с Ubuntu 14.04, живущий абсолютно на тех же условиях с тем же вайфаем, преспокойно работает, с него и пишу. Ни там, ни там я ничего не трогал, ну разве что на первом, возможно, чаще не глядя устанавливал прилетающие обновления.

Подскажите, плиз, чозадела и кагбыть.

Давай сюда выхлопы этих команд:

$ ip a $ ip route $ iptables -nvL $ cat /etc/resolve.conf

Btw, внезапно в браузере заработала mail.yandex.ru. При этом не работает yandex.ru. Бред какой-то.

[~] ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 link/ether 5c:f9:dd:60:0d:b0 brd ff:ff:ff:ff:ff:ff 3: wlan0: mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 68:17:29:32:4b:5f brd ff:ff:ff:ff:ff:ff inet 192.168.1.102/24 brd 192.168.1.255 scope global wlan0 valid_lft forever preferred_lft forever inet6 fe80::6a17:29ff:fe32:4b5f/64 scope link valid_lft forever preferred_lft forever 
[~] ip route default via 192.168.1.1 dev wlan0 proto static 192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.102 metric 9 
[~] iptables -nvL modprobe: ERROR: could not insert 'ip_tables': Operation not permitted iptables v1.4.21: can't initialize iptables table `filter': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. 
[~] cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1 

Источник

Читайте также:  Yota максимальная скорость мобильного интернета

Ping есть, а интернета нет

Ping есть на 8.8.8.8, а интернета нет 2 месяца на убунту 12.04.причина?

Plugin passwordfd.so loaded. AT OK ATZ OK AT+CGDCONT=1,"IP","internet.smarts.ru" OK ATD*99***1# CONNECT Serial connection established. Using interface ppp0 Connect: ppp0 /dev/ttyUSB0 CHAP authentication succeeded CHAP authentication succeeded Could not determine remote IP address: defaulting to 10.64.64.64 local IP address 10.20.135.251 remote IP address 10.64.64.64 

А пинг по названию домена есть, а не по адресу есть? Например, ping ya.ru

P.S. пингом мерить доступность хостов — бить линейкой по рукам

# ifconfig $ dig google.com $ ping google.com 

Ошибка 105 (net::ERR_NAME_NOT_RESOLVED): Не удается преобразовать DNS-адрес сервера.

lo Link encap:Локальная петля (Loopback) inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1453 errors:0 dropped:0 overruns:0 frame:0 TX packets:1453 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:120233 (120.2 KB) TX bytes:120233 (120.2 KB) ppp0 Link encap:Протокол PPP (Point-to-Point Protocol) inet addr:10.20.144.168 P-t-P:10.64.64.64 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:296 Metric:1 RX packets:37 errors:1 dropped:0 overruns:0 frame:0 TX packets:40 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:1934 (1.9 KB) TX bytes:2093 (2.0 KB) 
ping google.com ping: unknown host google.com ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_req=1 ttl=49 time=43.7 ms 64 bytes from 8.8.8.8: icmp_req=2 ttl=49 time=43.7 ms 64 bytes from 8.8.8.8: icmp_req=3 ttl=49 time=43.4 ms 64 bytes from 8.8.8.8: icmp_req=4 ttl=49 time=43.4 ms 64 bytes from 8.8.8.8: icmp_req=5 ttl=49 time=43.1 ms 64 bytes from 8.8.8.8: icmp_req=6 ttl=49 time=43.1 ms ^C --- 8.8.8.8 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5008ms rtt min/avg/max/mdev = 43.179/43.456/43.751/0.330 ms 

Источник

Оцените статью
Adblock
detector