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 have a problem. with the help from the people at this forum I managed to setup my network. To recapitulate i have two computers comp1 and comp2 connected like this

comp2(eth0) -> comp1(eth1)    
comp1(eth0) -> network

my interface looks like this:

comp1:

auto lo  
iface lo inet loopback  
auto eth0  
iface eth0 inet dhcp  
auto eth1  
iface eth1 inet static  
address 10.10.0.10  
netmask 255.255.255.0

comp2:

auto eth0  
iface eth0 inet static  
address 10.10.0.20  
netmask 255.255.255.0  
gateway 10.10.0.10  

comp2

$ route  
Kernel IP routing table  
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  
default         10.10.0.10       0.0.0.0         UG    100    0        0 eth0  
10.10.0.0        *               255.255.255.0   U     0      0        0 eth0 

comp1:

$ route  
Kernel IP routing table  
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    
default         g128.mp.l       0.0.0.0         UG    100    0        0 eth0  
10.10.0.0       *               255.255.255.0   U     0      0        0 eth1   
10.128.0.0      *               255.224.0.0     U     0      0        0 eth0 

Now: I can ssh into my comp2 and ping 8.8.8.8 and I get:

ping 8.8.8.8  
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.  
64 bytes from 8.8.8.8: icmp_req=1 ttl=43 time=42.6 ms  
64 bytes from 8.8.8.8: icmp_req=2 ttl=43 time=41.8 ms

But if I try to wget:

wget -O - 173.194.70.113 | grep google  
function n(){if(google.timers.load.t){google.timers.load.t.ol=(new Date).getTime();google.timers.load.t.iml=e;google.kCSI.imc=c;google.kCSI.imn=b;
google.kCSI.imp=d;void 0!==google.stt&&(google.kCS...

which is OK but if i try it like this:

wget -O - http://www.google.com |grep google  
--2013-11-21 15:07:35--  http://www.google.com/  
Resolving www.google.com (www.google.com)... failed: Temporary failure in name   resolution.  
wget: unable to resolve host address `www.google.com'  

which implies to me that this is a DNS server problem .

my less /etc/resolv.conf on comp1 looks like this:

Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)  
DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN  
nameserver 127.0.0.1  
search xxx.xxx.xxx 

xxx are not important but on comp2 it looks like this :

Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)  
DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN  

how to set this up?

share|improve this question
add comment

1 Answer

When you set a static IP address in /etc/network/interfaces, you are responsible to set DNS nameservers. I suggest you amend the file on comp2 to read:

auto lo  
iface lo inet loopback  

auto eth0  
iface eth0 inet static  
address 10.10.0.20  
netmask 255.255.255.0  
gateway 10.10.0.10  
dns-nameservers 8.8.8.8 8.8.4.4

Then get the system to re-read and use the change:

sudo ifdown eth0 && sudo ifup -v eth0

And test:

ping -c3 8.8.8.8
ping -c3 www.google.com
share|improve this answer
add comment

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.