Page 1 of 1

Can ping IP but not host

Posted: 21. May 2016, 20:15
by holden321
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
auto eth1

iface eth0 inet dhcp

iface eth1 inet static
address 192.168.56.102
netmask 255.255.255.0
gateway 10.0.2.2
I can do "ping 213.180.204.3" but can't do "ping ya[.]ru"

this "nslookup ya[.]ru 8.8.8.8" works ok
this "nslookup ya[.]ru" says "connection time out; no servers could be reached"

eth0 is NAT
eth1 is Host Only Adapter

If I switch off eth1 from the machine settings (leaving eth0) all works ok. But I can't switch off this iface.

Please help :roll:

Re: Can ping IP but not host

Posted: 21. May 2016, 20:41
by socratis
Your eth1 address is 192.168.56.102. This looks like a host-only choice of networking mode. The gateway is 10.0.2.2. That looks like a NAT networking mode. Your eth1 address and gateway are in completely different address ranges. Not gonna work. Why do you have to set it up manually and don't you just leave it to auto?

Re: Can ping IP but not host

Posted: 21. May 2016, 21:02
by holden321
Well, that configuration works fine for some time.
Second adapter (eth1) is for connecting through VPN

Re: Can ping IP but not host

Posted: 21. May 2016, 21:09
by socratis
I'm not a network expert, but I've seen too many posts where VPN had no success. But, I would wait for someone with more networking knowledge than myself...

Re: Can ping IP but not host

Posted: 21. May 2016, 21:22
by holden321
It starts to work if I add nameserver 8.8.8.8 here:
/etc/resolv.conf
But it's overwriting after reboot ^(