Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 7414  / 1 Year ago, wed, march 29, 2023, 5:44:00

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)


More From » 12.04

 Answers
4

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



auto eth0
iface eth0 inet static
address 192.168.2.2
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameservers 192.168.2.1


and then running



resolvconf -u


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.


[#37291] Wednesday, March 29, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
untroo

Total Points: 3
Total Questions: 110
Total Answers: 95

Location: Palestine
Member since Thu, Oct 28, 2021
3 Years ago
untroo questions
;