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)
It sounds like you aren't able to resolve domains via DNS. Assuming this is the case, you can likely fix it by adding a
dns-nameservers
line to/etc/network/interfaces
and then running
as root to update
/etc/resolv.conf
. Feel free to include a DNS search domain record (which is also typically handed out via DHCP). Refer to resolvconf(8) for more information.Its worth noting to you may need to restart your network after changing
/etc/network/interfaces
: