On 18 September 2015 at 03:29, Eric Haszlakiewicz <[email protected]> wrote: > On 9/17/2015 1:32 PM, Ottavio Caruso wrote: >> >> On 16 September 2015 at 23:13, Matt Sporleder <[email protected]> >> wrote: >>> >>> Show us a sample hosts entry and the full output of your ping, please. >> >> Ok, this is not necessary now. >> >> For some reasons, I have redone the whole process today and the >> entries were correctly redirected to 0.0.0.0 as expected. >> >> There must have been a file corruption when downloading the file from: >> http://winhelp2002.mvps.org/hosts.txt >> >> The first time I just downloaded it with wget. >> >> Now I have selected all text and copied it into leafpad, then moved it >> to /etc/hosts. >> >> There might have been some extra line feed that could have prevented >> the file from being parsed correctly. > > Yep, there definitely are carriage returns (not line feeds), but it's not > file corruption, it's just a MS Windows style text file. > If you open it in vi you'll clearly see all the "^M"'s at the end of each > line. > > Assuming you'll want to fetch an updated copy of that file in the future, > you can automatically trim those off with something like this: > ftp -o - http://winhelp2002.mvps.org/hosts.txt | tr -d '\r' > hosts.txt > > (wget should work too, but NetBSD's ftp does what you need without any extra > packages) >
Thank you for the tip. I've bookmarked it for the future. -- Ottavio
