[GH-ISSUE #1313] Also read /etc/hosts when using the firejail hosts-file option #897

Closed
opened 2026-05-05 07:05:11 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @ghost on GitHub (May 26, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1313

Would it be possible to add a parameter to hosts-file so it can also read /etc/hosts in addition to the new designated hosts file instead of only that file as it is currently ?

Originally created by @ghost on GitHub (May 26, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1313 Would it be possible to add a parameter to hosts-file so it can also read /etc/hosts in addition to the new designated hosts file instead of only that file as it is currently ?
gitea-mirror 2026-05-05 07:05:11 -06:00
Author
Owner

@netblue30 commented on GitHub (May 26, 2017):

Just configuring /etc/hostname would not be enough. Use --hostname= and it will set your hostname the right way.

<!-- gh-comment-id:304278556 --> @netblue30 commented on GitHub (May 26, 2017): Just configuring /etc/hostname would not be enough. Use --hostname= and it will set your hostname the right way.
Author
Owner

@ghost commented on GitHub (May 26, 2017):

I apologize for not making myself more clear.
Let's say I have as /etc/hosts this file: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
And somewhere in my home directory I have this seperate hosts file, let's say in ~/.hosts

0.0.0.0 github.com
0.0.0.0 button.org

Now if I add
hosts-file ~/.hosts to my aplication profile that application will start using the designated hosts file ignoring /etc/hosts.

I'm wondering if it would be possible to add an option to include /etc/hosts along with the designated hosts file.

I thought this would be a good idea for some reason a few hours ago but now I see that it's just better to just cp /etc/hosts ~/.hosts and then cat second_hosts_file >> ~/.hosts everytime second_hosts_file changes.

<!-- gh-comment-id:304394975 --> @ghost commented on GitHub (May 26, 2017): I apologize for not making myself more clear. Let's say I have as /etc/hosts this file: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts And somewhere in my home directory I have this seperate hosts file, let's say in ~/.hosts ``` 0.0.0.0 github.com 0.0.0.0 button.org ``` Now if I add `hosts-file ~/.hosts` to my aplication profile that application will start using the designated hosts file ignoring /etc/hosts. I'm wondering if it would be possible to add an option to include /etc/hosts along with the designated hosts file. I thought this would be a good idea for some reason a few hours ago but now I see that it's just better to just cp /etc/hosts ~/.hosts and then cat second_hosts_file >> ~/.hosts everytime second_hosts_file changes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#897
No description provided.