Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
1  
When trying to ping 8.8.8.8 I get "Connect: Network is unreachable" –  Clob Aug 24 '13 at 23:26
    
The dns-nameservers option mentioned in the previous post works. But this option is not mentioned in the helpfile "man interfaces" which is ackward. I think it should be possible in KDE to configure a static IP with all parameters in system settings -> network settings, but this option is not available in KDE. –  user265541 Apr 5 at 8:07

2 Answers 2

up vote 3 down vote accepted

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. ;)

share|improve this answer
1  
Thanks, I booked marked this for future reference. –  Clob Aug 25 '13 at 18:04

This is not an issue with the DNS, but with the overall internet connection for your VM.

This should be an issue with how you are providing the network connection to the VM client via the host. Explore the possible solutions more with that bend. If it was only an issue with the DNS, your pings would succeed.

Try to make the connection on the VM to NAT rather than to bridge it. See if the connectivity comes up. Once you have the connection to the internet, the DNS should work just fine.

share|improve this answer
1  
Well, the internet connection was working fine before I removed DHCP in bridged mode. My mistake was removing DHCP instead of understanding how to set the static IP around it. I restored a backup and undid my mistake. Thanks though! –  Clob Aug 25 '13 at 18:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.