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

2 Answers 2

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

I had a similar problem,in my case,ping/dig/nslookup were ok but wget/curl and the firefox not worked fine.And I edited the /etc/resole.conf to use another namespace such as 114.114.115.115,everything was ok.I also tried to set the same dns in windows7,everything still was ok which made me confused.But I found an article in which people discussed the issue caused by ipv6. Finally,I fixed the issue by disabling the ipv6 in Ubuntu using the sysctl utility with the following steps.

#show whether the ipv6 disable or not sudo sysctl -a | grep disable_ipv6 #disable all the ipv6 sudo sysctl -w net.ipv6.conf.all.disable_ipv6 = 1 sudo sysctl -w net.ipv6.conf.default.disable_ipv6 = 1 #also you can check the settings sudo sysctl -a | grep disable_ipv6

After that,I could connect to the internet without problem. Hopefully it can help you!

Btw, if you need to make the above settings permanently, you should edit the file '/etc/sysctl.conf' and append the following lines:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
share|improve this answer

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.