Rootserver Sponsor

webtropia"

Donations

Please support your operating system's further development:

donate"

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
finottiOffline
Post subject: hosts file and flusing DNS cache  PostPosted: 05.10.2015, 18:36



Joined: 2010-09-12
Posts: 493

Status: Offline
Dear all,

It was suggested to me to use the hosts file to protect my computers. In particular, this script was recommended: https://github.com/StevenBlack/hosts

The script works fine in creating a new hosts with the sources listed, but it mentions that I need to "flush the DNS cache" to have the changes applied without a reboot. Googling around, it seems that this would be accomplished by

      Code:

service nscd restart


But, I don't have nscd installed. I looked up the package (with apt-cache show) and noticed this:

      Quote:

Description-en: GNU C Library: Name Service Cache Daemon
A daemon which handles passwd, group and host lookups
for running programs and caches the results for the next
query. You should install this package only if you use
slow services like LDAP, NIS or NIS+.


So, it is not clear if I need it. Is there another way to make the changes to hosts file take effect?

Thanks!

Luis

P.S.: Is

      Code:

systemctl restart networking.service


the answer? I found it in the bottom of the script Github page, but either is has a typo (for using "network.service"), or it does not work.
 
 View user's profile Send private message  
Reply with quote Back to top
LatOffline
Post subject: RE: hosts file and flusing DNS cache  PostPosted: 07.10.2015, 00:51



Joined: 2010-09-19
Posts: 205

Status: Offline
I've never done anything after modifying /etc/hosts. All changes work. I even modify the /etc/hosts of my rooted Android devices.
P.D: The more lines /etc/hosts has, the slower might become to resolve in slower machines.
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: hosts file and flusing DNS cache  PostPosted: 07.10.2015, 18:59



Joined: 2010-09-12
Posts: 493

Status: Offline
Thanks, Lat. Of course, you are correct! I tried changing the file and check the connections, and indeed, the changes take effect immediately. Thanks for the info! (Networking is still a big mystery to me...)
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio