- How to fix «-5 No address associated with hostname error» while updating?
- 5 Answers 5
- Not the answer you’re looking for? Browse other questions tagged 12.04 apt updates software-sources or ask your own question.
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
- CentOS 6.7: ‘No address associated with name’ as ‘hostname —fqdn’ output
- 2 Answers 2
- Solving the Ubuntu 12.04 Update Error: (-5 — No address associated with hostname) [duplicate]
- 5 Answers 5
- Symptom:
- Solution:
- Command Line Method
- GUI Method
- No address associated with hostname linux
- Re: (-5 — No address associated with hostname)
- Re: (-5 — No address associated with hostname)
- Re: (-5 — No address associated with hostname)
- Re: (-5 — No address associated with hostname)
- Re: (-5 — No address associated with hostname)
- Re: (-5 — No address associated with hostname)
- Re: (-5 — No address associated with hostname)
How to fix «-5 No address associated with hostname error» while updating?
I am getting this error frequently while updating Ubuntu 12.04 LTS. How can I fix it? Log is:
5 Answers 5
This has been a long term problem with apt, and Ubuntu has never fixed it. Apt doesn’t seem to use the same DNS servers that the internal system does — ‘ping ‘ returns a correct IP address. Apt-get claims that the hostname isn’t found.
«Something wicked happened resolving ‘extras.ubuntu.com:http» (Which sounds, somewhat, like it’s trying to resolve a .com:http domain, which isn’t a valid TLD)
To modify /etc/hosts, use the following:
Ping each of the names that are failing to resolve — PING extras.ubuntu.com (91.189.88.33) 56(84) bytes of data.
Use your favourite editor, such as vi — ‘sudo vi /etc/hosts’.
Scroll down to the end, and add a line such as the following
Save the file, then re-run apt-get. Once you’ve run apt-get, edit /etc/hosts again, and comment out the line with a hash mark — #. (or delete it entirely)
The reason to comment out/delete the line is that Ubuntu apparently shuffles their servers around randomly, and that might not be the correct IP the next time.
http://archive.scrapy.org/ seems like a perfectly working Ubuntu mirror, so while I’d usually ask you to provide information about what Software Sources are configured, it looks like this problem is either specific to your Ubuntu system, or was a short-lived problem with (or accessing) your DNS server. (The problem is not actually with the server at http://archive.scrapy.org/ itself, though it may have been due to a configuration problem for that server’s DNS record.)
This is, of course, assuming that you have Internet access on the affected machine. If you don’t, then you need to connect to the Internet before updating. It’s quite normal to see errors like that if you don’t have Internet access, or if your Internet connection itself is interrupted.
The problem may have gone away by itself. If not, you can try a different DNS server ( 8.8.8.8 and 8.8.4.4 are good public DNS servers operated by Google), and/or try a different mirror for updating Ubuntu.
That hostname resolves to an Amazon EC2 instance. It’s possible there was some transient issue which is now solved as it resolves fine here. Does it now work for you?
When I got this error, I put the IP address of the Ubuntu mirror in /etc/hosts. No more error. (When I queried the mirror in DNS there was never a problem or delay in response, so I’m not sure of the root cause of the error.)
I got the «No address associated with hostname» message with Centos 6.5 when I said yes to IPv6 and apparently the ISP DHCP didn’t have it. It solved the problem when I commented out the line in /etc/hosts :
Not the answer you’re looking for? Browse other questions tagged 12.04 apt updates software-sources or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник
CentOS 6.7: ‘No address associated with name’ as ‘hostname —fqdn’ output
I have CentOS 6.7 x64 (Final) Desktop standard installation, on a dedicated pc (not on a VM), Linux version 2.6.32-573.el6.x86_64 (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ).
I’ve configured my /etc/sysconfig/network-scripts/ifcfg-eth0 file as follow:
After, I’ve modified my /etc/hosts and /etc/sysconfig/network as:
As result, I’ve got that I can go on the web (I’m on with this configuration by now), but when I run:
instead of a correct FQDN response.
I would need to know how to solve this situation and get the right output.
PS: I don’t know if it has something to do with this problem, but my modem-router has the DHCP activated and the provider does not allow to disable it (or better, it can not be disabled by the user with official versions of the firmware).
2 Answers 2
You can set the hostname using hostname command hostname man page
From the man page, «Hostname is the program that is used to either set or display the current host, domain or node name of the system. These names are used by many of the networking programs to identify the machine. The domain name is also used by NIS/YP.
You can’t change the FQDN (as returned by hostname —fqdn) or the DNS domain name (as returned by dnsdomainname) with this command. The FQDN of the system is the name that the resolver(3) returns for the host name. Technically: The FQDN is the name gethostbyname(2) returns for the host name returned by gethostname(2). The DNS domain name is the part after the first dot.
Therefore it depends on the configuration (usually in /etc/host.conf) how you can change it. Usually (if the hosts file is parsed before DNS or NIS) you can change it in /etc/hosts.
If a machine has multiple network interfaces/addresses or is used in a mobile environment, then it may either have multiple FQDNs/domain names or none at all. Therefore avoid using hostname —fqdn, hostname —domain and dnsdomainname. hostname —ip-address is subject to the same limitations so it should be avoided as well.»
Add to your /etc/hosts a reference to 127.0.0.1 with the fqdn as first row, and it should work.
EDIT: I noticed you changed the 127.0.0.1 with the IP of the machine. You always must have 127.0.0.1 in your /etc/hosts, as this indicates the loopback interface which is used by different applications and services.
Источник
Solving the Ubuntu 12.04 Update Error: (-5 — No address associated with hostname) [duplicate]
Problem Description:
Each time i try to download the updates for my operating system (Ubuntu 12.04) i get the following list of error messages:
The Contents of (/etc/apt/sources.list) File:
The Files inside of (/etc/apt/sources.list.d) directory:
Related Links to this Post on AskUbuntu.com:
I have tried to research online for ways to solve the issue but i failed to figure out the real reason why i am getting those errors. Any suggestions, ideas or solutions that might aid me to solve this issue are greatly appreciated.
5 Answers 5
The solution to this problem goes as follows:
Step 1: Go to System –> Preferences –> Network Connections.
Step 2: Next, select your default Network Interface (eth0) and click ‘Edit’.
Step 3: Then select ‘IPv4 Settings’ and choose ‘Automatic (DHCP) addresses only’.
Step 4: Next, enter the new DNS server addresses in the ‘DNS servers’ box. Use commas to separate multiple addresses and click ‘Apply’ to save.
Step 5: Choose your preferred DNS details
After configuring, check to make sure it is working by going online.
The above link explains how to change the DNS Settings in Ubuntu.
I had this same problem and none of the above answers fixed it. I DO have it fixed now however. Turns out all I needed to do was go into terminal and type sudo apt-get update . After it finished running, my update manager refreshed, gave me a new list of items to update and then I clicked update and everything ran fine. Don’t know if this will help anyone else, but I hope it does.
If you are getting only errors relating to packages.medibuntu.org , that repository has closed according to the official repo page on launchpad and these discussion threads.
Symptom:
Solution:
Command Line Method
- Remove medibuntu repo from your /etc/apt/sources.list.d directory: sudo rm /etc/apt/sources.list.d/medibuntu.list*
- Run sudo apt-get update
- (optional) If you still see errors after this, run grep -lir medibuntu /etc/apt/sources.list.d/ | xargs sudo rm , then try running step 2 again.
GUI Method
- Open Synaptic Package Manager (Press Super / Winkey then type Synaptic Package Manager and click the first app result that shows up named Synaptic Package Manager )
- In the app’s menu, select Settings -> Repositories
- Select the Other Software tab, then scroll down and uncheck or remove all entries for packages.medibuntu.org (see screenshot)
Источник
No address associated with hostname linux
Hello all! This is my first time on the forum as I am quite new to Raspberry Pi. I just am looking for some clarity as to what is going when trying update and install anything. After running sudo apt-get update I received a variety of messages that looked like this:
W: Failed to fetch http://archive.raspberrypi.org/debian/d . f/Packages Something wicked happened resolving ‘archive.raspberrypi.org:http’ (-5 — No address associated with hostname)
There are about 20 of these all having to do with
Ign http://archive.raspberrypi.org wheezy Release
Ign http://repository.wolfram.com stable Release
Ign http://raspberrypi.collabora.com wheezy Release
It seemed like sudo apt-get update was working at first until it said that some files could not be authenticated. Since then I have not been able to resolve any hostname. I have tried pinging google to no avail.
I am guessing this has something to do with my etc/apt/sources.lists.d file?
Any clarity as to how I can fix this is much appreciated.
Re: (-5 — No address associated with hostname)
Lets start with the basics.
1. When you logon to your Raspberry Pi what do you see? If you’re going straight to the GUI open an LXTerminal window. There should be something that looks a bit like:
login as: pi
password:
Linux aplus 3.12.32+ #721 PREEMPT Fri Nov 7 16:50:31 GMT 2014 armv6l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Nov 19 16:13:00 2014 from 192.168.0.33
pi@aplus
That final green/blue prompt, usually, gives you your username and your hostname.
2. What does a cat /etc/hostname command show?
3. What do the following commands give you?
hostname
hostname -A
hostname -i
hostname -I
4. What does a cat /etc/hosts command show?
5. And what do you get from running this python program?
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors — are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: (-5 — No address associated with hostname)
That final green/blue prompt, usually, gives you your username and your hostname.
2. What does a cat /etc/hostname command show?
127.0.0.1 local host
::1 localhost ip6-localhost ip6-lookback
fe00::0 ip6-localnet
ff00::0 ip6-localnet
ff02::0 ip6-allnodes
ff02::2 ip6-allrouters
Re: (-5 — No address associated with hostname)
It looks to me like your DNS isn’t working correctly. Perhaps your router isn’t handling DNS queries?
First check to see that you have a working internet connection
Re: (-5 — No address associated with hostname)
Did you have a chance to run my python program, as it’ll check connectivity to your gateway (192.168.3.1) machine?
Try
sudo apt-get update && sudo apt-get upgrade
to ensure your cached apt metadata is up to date.
If it still fails we need to look at /etc/apt/sources.list.d/ to see if there’s anything wonky in there. It would also help to have a copy of your /var/log/apt/term.log (you can post that on pastebin and post a link here if it’s too big).
Those «ign» lines that you’ve posted are informational messages and can be ignored (you’d guess that from «ign»).
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors — are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: (-5 — No address associated with hostname)
Re: (-5 — No address associated with hostname)
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors — are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: (-5 — No address associated with hostname)
Running into the same problem did upgrade my DSL connection last January, 1st time to update since this upgrade.
Really don’t know how to solve this issue
Trying to run
sudo apt-get update
do get loads of errors like
W: Failed to fetch http://raspberrypi.collabora.com/dists/ . elease.gpg Something wicked happened resolving ‘host:http’ (-5 — No
address associated with hostname)
Already Tried to search the forum did not manage to solve the issue
ping google.com
responds normal
— google.com ping statistics —
114 packets transmitted, 114 received, 0% packet loss, time 113173ms
rtt min/avg/max/mdev = 19.390/24.136/42.980/5.536 ms
$ ping -c 1 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=53 time=22.4 ms
— 8.8.8.8 ping statistics —
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 22.484/22.484/22.484/0.000 ms
cat /etc/hostname
raspberrypi
hostname -A
raspberrypi.local
hostname -i
127.0.1.1
hostname -I
192.168.2.58
cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 raspberrypi
cat /etc/resolv.conf
8.8.8.8
sudo sh -c «echo 8.8.8.8 >/etc/resolv.conf»
(does not show anything)
ping -c 1 -W 5 google.com
ping: unknown host google.com
/etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
# Uncomment line below then ‘apt-get update’ to enable ‘apt-get source’
# deb-src http://mirror.ox.ac.uk/sites/archive.ra . /raspbian/ wheezy main contrib non-free rpi
host google.co.uk
;; connection timed out; no servers could be reached
host www.pythonforbeginners.com
;; connection timed out; no servers could be reached
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.2.254 0.0.0.0 UG 0 0 0 eth0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
ping -c3 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=53 time=20.3 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=53 time=20.5 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=53 time=20.3 ms
— 8.8.8.8 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 20.301/20.394/20.517/0.188 ms
traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 192.168.2.254 (192.168.2.254) 0.636 ms 0.357 ms 0.424 ms
2 195.190.228.186 (195.190.228.186) 15.410 ms 15.705 ms 17.310 ms
3 * * *
4 145.54.47.246 (145.54.47.246) 22.802 ms 23.646 ms 25.011 ms
5 145.54.47.250 (145.54.47.250) 25.401 ms 26.269 ms 27.612 ms
6 139.156.156.133 (139.156.156.133) 28.007 ms 19.106 ms 19.797 ms
7 139.156.127.73 (139.156.127.73) 21.917 ms 20.353 ms 139.156.127.77 (139.156.127.77) 21.430 ms
8 * * *
9 8.8.8.8 (8.8.8.8) 23.468 ms 108.170.236.137 (108.170.236.137) 25.081 ms 8.8.8.8 (8.8.8.8) 24.936 ms
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 7.3G 4.9G 2.1G 71% /
devtmpfs 484M 0 484M 0% /dev
tmpfs 98M 204K 98M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 196M 0 196M 0% /run/shm
/dev/mmcblk0p1 56M 24M 33M 43% /boot
none 488M 0 488M 0% /sys/fs/cgroup
Источник