Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
16
rated 0 times [  16] [ 0]  / answers: 1 / hits: 30602  / 1 Year ago, sun, february 5, 2023, 6:31:55

I'm experiencing what appears to be a name resolution issue in Ubuntu 12.04 Server edition when configuring my computer to use static ip.



In /etc/network/interfaces:



# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.28
netmask 255.255.255.0
gateway 192.168.1.1


Running $ sudo apt-get upgrade, results in a 'Failed to fetch...':



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


When I change my /etc/network/interfaces to:



auto eth0
iface eth0 inet dhcp


Everything works fine.



Looking into /etc/resolv.conf provides some more hints.



In cases where I was getting the resolving issue, resolv.conf was empty; no nameservers were specified. Then I changed to DHCP from static and restarted networking; /etc/resolv.conf got changed to: 'nameserver 192.168.1.1'.



Switching back from DHCP to static and restarting doesn't remove the nameserver entry. But when I restarted the system with static set, resolv.conf was empty. When I restart the system with DHCP set, resolv.conf has nameserver 192.168.1.1. So, it appears that the issue is that resolve.conf is not getting written to correctly? Which package/code is responsible for writing to resolv.conf? Is there a particular package that I can take a look at open issues?



UPDATE:
istream posted a good article discussing changes to resolve.conf in 12.04.
http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/


More From » 12.04

 Answers
0

As per the resolvconf man page (example provided in man page), add the following to your /etc/network/interfaces under your static configuration:



dns-nameservers [IP address(es) of your DNS]     
dns-search [your dns-search strings (optional)]

[#38954] Sunday, February 5, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wheance

Total Points: 314
Total Questions: 96
Total Answers: 112

Location: Benin
Member since Thu, Aug 12, 2021
3 Years ago
;