Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I recently assembled a new computer with both Windows 7 boot and Ubuntu 11.04 boot. For some reason, I can not resolve domain names at all on in Ubuntu while Windows 7 works just fine. I'm wondering if I have improperly configured my network settings. I am trying to configure this machine to have a static IP on my network of 192.168.1.3
The machine definitely has its network card installed properly and in Ubuntu I can access numeric ip addresses anywhere via browser or ssh. When I type in "google.com" in a browser I get an instant 'server not found' error page.
Anything that is described in my hosts file seems to work just fine.
I can ping my router which has a LAN IP of 192.168.1.1 just fine with no packet loss.
Here are the contents of /etc/network/interfaces:
Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.3
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
If I type in nslookup commands or dig commands they just time out. Wondering what the story is here.
Also, I am unable to access this machine via ssh from any other machine on the network. Wondering what might be wrong. Any tips are greatly desired.
Thanks for your response! /etc/resolv.conf does not have a nameserver directive in it. It has a comment and that is all. Should I add a nameserver directive?
You're system must run dhcpcd in order to get a correct IP-configuration from the DHCP-server. If you configure for a static IP you must instead tell dhcpcd not to overwrite the nameserver-entry in /etc/resolv.conf. In order to achieve this, you'll have to insert a line
Markush, thanks for the additional information. Unfortunately, I'm not certain whether dhcpcd is active (or even what it is).
When I initially installed Ubuntu from the CD, I don't believe I was prompted for dhcp versus static IP. I followed this how-to document to configure it with a static IP.
Do I still need that line in my /etc/dhcpcd.conf ?
mh, if you have the file /etc/dhcpcd.conf (it maybe on another place in Ubuntu) you'll know that dhcpcd is installed. Note that every distribution installs a DHCP-client-daemon by default (there are others than dhcpcd) since without it DHCP will not work and most systems use DHCP at least while installation.
The answer to your question: if you have a dhcpcd.conf file, insert the line I described in my last post and just try it out.
Note also that if you restart the system and don't have the line "nohook resolv.conf" in your dhcpcd.conf file, dhcpcd will overwrite your nameserver again.
Thanks again for the info. Rep++. I rebooted my machine and it still seems to be working. I can resolve remote hostnames and my resolv.conf file still contains the nameserver bit. This seems safe.
This file does not contain any 'nohook' lines but my system is still working after a reboot. Would that nohook command belong in this file? Is it necessary.
seems to configure that dhclient will configure the nameserver entry in resolv.conf.
I don't know if the "overwriting /etc/resolv.conf" is a speciality of dhcpcd or if it is a general behavior of any dhcpclient. I'd recommend to read the manpages for
Code:
man dhclient
man dhclient.conf
btw, thanks for the reputations, hopefully this thread will help other users as well.
Provided that you are running locate (many distros do this by default) it is easier and more convenient (and faster) to use 'locate' (sometimes, slocate) to perform simple file searches like this
Quote:
locate dhcpcd.conf
'find' is better if you want to do clever stuff, like search by modification date, or whatever, but locate is so fast that I'd have difficulty working efficiently without it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.