Closed ford153focus closed 4 years ago
The issue is that you are adding two entries with the same name, so the second time you call hosts.add
, the library sees a duplicate and ignores it.
If you add force=True
when adding the second entry, the hosts file will contain: ::1 mc.yandex.ru
because you are forcing the removal of any existing entries with the same name before adding.
It doesn't really make sense to have multiple host file entries with the same name as i assume the OS will read the first only and ignore the second.
Many thanks!
Hello! I have next code:
I'm expecting to see in
/etc/hosts
2 records:127.0.0.1 mc.yandex.ru
and::1 mc.yandex.ru
, but only first is appeared.Did i something wrong?