Saturday, February 26, 2011

'Something wicked happened resolving *** ... No address associated with hostname' - Installation Error in Ubuntu

This is another common repository error in Ubuntu. It can appear in any package manager including but not limited to apt-get, Software Center, Synaptic, aptitude etc. The fact is that if one of the package manager is having problem, it will be the same in all others as all of them probably depend on apt-get running in the background.

If you are getting this error, you may or may not notice some Internet browsing problems in your web browser.

The error message looks like this:

Something wicked happened resolving '***.***.***:http' (-5 -  No address associated with hostname)

Cause

Most of us now-a-days depend on a DHCP Server to assign automatic IPs, subnet masks, DNS Server addresses etc to our systems. Almost all the routers come with a built-in DHCP Server which automatically assigns addresses and by default, it assigns the routers address as a DNS Server. This is where the problem starts. Your computer needs to be talking to your ISPs DNS Server (or some other) for resolving addresses but this is not happening. Instead, it is talking to the router which is not capable of name resolution.

Solution

The solution is simple. Either find your ISP's DNS Server and configure your system to use that instead of the router's address or you can use some free alternatives like Google DNS, OpenDNS etc.

Google DNS Example: Changing DNS server settings on Ubuntu
  1. In the System menu, click Preferences, then click Network Connections.
  2. Select the connection for which you want to configure Google Public DNS. For example:
    • To change the settings for an Ethernet connection, select the Wired tab, then select your network interface in the list. It is usually called eth0.
    • To change the settings for a wireless connection, select the Wireless tab, then select the appropriate wireless network.
  3. Click Edit, and in the window that appears, select the IPv4 Settings tab.
  4. If the selected method is Automatic (DHCP), open the dropdown and select Automatic (DHCP) addresses only instead. If the method is set to something else, do not change it.
  5. In the DNS servers field, enter the Google Public DNS IP addresses, separated by a space: 8.8.8.8  8.8.4.4
  6. Click Apply to save the change. If you are prompted for a password or confirmation, type the password or provide confirmation.
  7. Test that your setup is working correctly; see Testing your new settings.
  8. Repeat the procedure for additional network connections you want to change.

Related Posts:

Installation , Package Manager , Troubleshooting