Update /etc/hosts when linked container is restarted

Fix #6350


What's the point of `parents` param here? `C-Style`? You can name returning params btw:
```
func (db *Database) parents(e *Entity) (parents []string, err error)
```
And you'll have this variables in function, and can write just `return` to returning them immediately :) But I prefer explicit declarations for simple cases.