Re:When Will The Social Sharing Button Madness Stop
by pluies_public on Tuesday April 17, 2012 @06:13PM
(#3855303)
You're going to need way more than that for all their subdomains, CDN, CDN's subdomains, etc. Not to mention having to keep it all up to date in case they roll out a new domain.
That said, I use the same technique. :)
Re:When Will The Social Sharing Button Madness Stop
by Produce on Tuesday April 17, 2012 @07:46PM
(#3855631)
Perhaps someone should create a repo on github containing all of the social sites' hostnames. looking at you
Re:When Will The Social Sharing Button Madness Stop
by dredmorbius on Tuesday April 17, 2012 @09:44PM
(#3856046)
Run a nameserver and be authoritative for the entire domain.
Redirect at will.
Re:When Will The Social Sharing Button Madness Stop
by hippee-lee on Tuesday April 17, 2012 @07:37PM
(#3855607)
So, if you just add the localhost address to etc hosts then nothing from the url will load in your browser?
Re:When Will The Social Sharing Button Madness Stop
by Nick_C on Thursday April 19, 2012 @12:30AM
(#3861399)
Assuming /etc/resolv.conf is set up with "search <localdomain>" before any nameserver entries (which it invariably is), then any DNS query will first try the localhost.
In the absence of a nameserver on the local host, then the DNS lookup will search /etc/hosts, where it will find an entry for facebook.com that resolves to 127.0.0.1 (localhost).
Now the browser knows where to find facebook.com. It requests the web server at localhost to serve the URL. If there is no webserver, the browser gets back a "connection refused". If there is a webserver, the browser gets back a 404 error.
In either case, the browser just moves on to the next request.
Since it all happens on localhost, it is blazingly fast compared to an internet lookup, and the user won't realise.
Re:When Will The Social Sharing Button Madness Stop
by hippee-lee on Wednesday April 25, 2012 @05:37PM
(#3891232)
Thanks for the clear explanation. Now I understand what I am doing when I modify my hosts file like this.
127.0.0.1 facebook.com