Question

I want to succesfully ping some hostnames. These hostnames have the same IP, 127.0.0.1

So i edited /etc/network/hosts:

127.0.0.1 host1 
127.0.0.1 host2 
127.0.0.1 host3
127.0.0.1 host4
127.0.0.1 host5 
127.0.0.1 host6
127.0.0.1 host7 
127.0.0.1 host8 
127.0.0.1 host9

My /etc/network/interfaces file was:

auto lo
iface lo inet loopback

Then i added this:

iface eth0 inet static
 address 127.0.0.1
 network 127.0.0.0
 netmask 255.255.255.0
 broadcast 127.0.0.255

But when i try to do:

ping host1

it doesn't work, even with other hostnames in /etc/network/hosts

Was it helpful?

Solution

In the recent kernels the couples hostname-IP are saved in /etc/hosts, not in /etc/network/hosts, the edit in /etc/network/interfaces is useless, i just tried everything

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top