fix for reading hosts file

On my osx, use a+ to open a file couldn't read any content, use r for
generally.