Static IP configuration causing apt-get errors

Posted by JPbuntu on Ask Ubuntu See other posts from Ask Ubuntu or by JPbuntu
Published on 2012-06-25T18:24:30Z Indexed on 2012/11/23 17:19 UTC
Read the original article Hit count: 319

Filed under:
|
|
|

I am getting errors when running apt-get update or when installing new packages. Although this only happens when the server configured for a static IP address. Changing the configuration back to DHCP and restarting networking fixes the problem, although I want a static IP. Once it is working I can change back to my static IP address and restart networking. Although this only works until I restart the server (restarting the router is ok), and then I start getting the same errors and have to switch back to DHCP.

Any ideas on what could be causing this or tips on troubleshooting it? Thanks in advance.

  • here is my static IP configuration:

    auto eth0
    iface eth0 inet static
        address 192.168.2.2
        netmask 255.255.255.0
        gateway 192.168.2.1
    
  • The apt-get update errors go something like this:

    A few of these

    Ign http://us.archive.ubuntu.com precise-backports InRelease
    

    then a lot of these

    Err http://security.ubuntu.com precise-security Release.gpg   Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    

    and a lot of these

    W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/universe/i18n/Translation-en  Something wicked happened resolving 'us.archive.ubuntu.com:http' (-5 - No address associated with hostname)
    

© Ask Ubuntu or respective owner

Related posts about 12.04

Related posts about networking