Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 24721  / 2 Years ago, sat, august 20, 2022, 1:29:35

I'm running Ubuntu 13.04.



I uninstalled DHCP.



I set my IP address to 192.168.1.200 and it's working just fine. I can connect to it via my other internet network machines.



However, I've tried to set DNS in /etc/network/interfaces to:



dns-nameservers 8.8.8.8 8.8.4.4


And that doesn't work. I tried the prepend before it also.



I tried the resolve.conf and resolve.conf.d/head and tail with nameserver 8.8.8.8 and that doesn't work.



I restart each of the services each time I edit them and try to resolve an address and I get the typical unknown host www.google.com. I've restarted the VM too (it's set to bridged in VirtualBox).



I can't re-install DHCP from repositories because DNS isn't working.



Can someone please help me? I'm getting pretty frustrated. I've tried every solution I can find on google.


More From » networking

 Answers
6

When you do not want to use DHCP and/or want NetworkManager to ignore some interface that you want to manage manually, just provide a configuration via /etc/network/interfaces. The interface will then be ignored by NetworkManager. See



$ man interfaces


for further info on how to configure interfaces manually. This is a template file (snippet) that configures the interface eth0:



auto eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8


Obviously you need to change the IP addresses. Note that the last line is evaluated by resolconf (it's a package/program, I don't mean the resolv.conf file), when and only when the interface is brought up successfully. You can check if the interface is up with /sbin/ifconfig. That should output the keyword UP and the IP somewhere. gateway in the above snippet denotes the IP of your router. Check if this ip appears in your route with the command route -n. Then ping your router. If that works, then you could ping 8.8.8.8. If that works check if the DNS correctly appears in the /etc/resolv.conf file. If it does, then check if you can resolve DNS names. In that order. If something in betweens fails, it is not a problem with your DNS.



If you're not able to get this straight using /etc/network/interfaces (package ifupdown) and want to know how to bring up an interface with basic commands, drop a comment.



Then you need to investigate how the trouble started in the first place. You've learnt already that you first need to clarify that your machine is able to ping 8.8.8.8 before you conclude to an error at resolving DNS though that server. If all that works fine, but the resolver entry just doesn't get tranfered correctly from /etc/network/interfaces to /etc/resolv.conf then continue your research at the documentation of the package resolvconf.



CONCLUSION:



Do not deinstall your dhcp software, when you depend on the internet connection and have few experiences on how to configure an interface manually. There are a lot of high level packages involved with bringing up an interface, namely network-manager, ifupdown and resolvconf and others. Which one does what is not obvious. ;)


[#29796] Saturday, August 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ntlesslving

Total Points: 123
Total Questions: 109
Total Answers: 113

Location: South Korea
Member since Fri, Sep 11, 2020
4 Years ago
;