Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

how to remove duplicate entries from hosts file?


  • This topic is locked This topic is locked

#1
roundtangent

roundtangent

    New Member

  • Member
  • Pip
  • 4 posts
Hi.

i am using spybot search and destroy and mvps hosts file.they both added many entries in hosts file.
now my hosts file is too big .it is around 30000 lines. there are many duplicate entries. how i can remove duplicate entries.

i searched but could not find the exact thing i wanted. there are couples of batch files available which remove duplicate entries but only if they are tab limited.

is there any option in some advanced text editor to do this job?

please help.
thanks
  • 0

Advertisements


#2
hfcg

hfcg

    The hippie freak computer geek

  • Member
  • PipPipPipPipPip
  • 2,496 posts
Hello,
30,000 lines would be a big job to manually edit.
Looking around, the only programs that claim to remove duplicate host files are registry cleaners.
Do not use these registry cleaners!

http://miekiemoes.bl...weaking_13.html

The way it works is that a good add says it will fix/speed up your computer and the download is free. But in order to fix any thing you have to buy it. And it does not fix any thing, some times causing great harm!

Can you rebuild the host file, as you want it, with out great difficulty? If so consider starting over from scratch.
In the meantime, I will keep looking for a good/real host file cleaner.
  • 0

#3
hfcg

hfcg

    The hippie freak computer geek

  • Member
  • PipPipPipPipPip
  • 2,496 posts
Here are a couple of programs that I found.
Use at your own risk!
I do not endorse nor recommend these programs.
I have never used these programs, and do not know any thing about them!


http://www.download....4-10159874.html


http://software.tech...px?docid=452729
  • 0

#4
roundtangent

roundtangent

    New Member

  • Topic Starter
  • Member
  • Pip
  • 4 posts
i was searching about this issue and there was an article that import file into excel and then sort the entries and delete duplicates. i tried to do that but was not successful. another problem is that i have very few entries which are not being redirected to 127.0.0.1.for example

normal entry should look like

127.0.0.1 abc.net

but those few entries are like

abz.net

what does it mean?

thanks
  • 0

#5
hfcg

hfcg

    The hippie freak computer geek

  • Member
  • PipPipPipPipPip
  • 2,496 posts
127.0.0.1 is your computer. it is a feedback loop.
As far as the other, I feel that may be malware related and I am not qualified to answer that. (plus I just plain do not know)
  • 0

#6
Broni

Broni

    Kraków my love :)

  • Member
  • PipPipPipPipPipPipPipPip
  • 12,300 posts
As hfcg said, start from the scratch.
Reset host file....
Download HostsXpert ( http://www.majorgeek...ster_d4626.html ) and then follow the steps below:

* Unzip HostsXpert.zip
* It will create a folder named HostsXpert in whatever folder you extract it to.
* Run HostsXpert.exe by double clicking on it.
* click Restore MS Hosts File and then click OK.
* Click the X to exit the program

Restart computer.

Get new mvps hosts file.
  • 0

#7
SpywareDr

SpywareDr

    Member 3k

  • Member
  • PipPipPipPipPipPip
  • 3,996 posts
FWIW, here's my UNEEK.BAT. (It works for me. :D):

@echo off > uneek.txt
if %1'==' echo Syntax: %0 filename.ext && goto :eof
if not exist %1 echo %1 not found && goto :eof
echo Removing duplicate lines from "%1" ...
for /f "tokens=* delims= " %%x in (%1) do (
find "%%x" < uneek.txt > nul
if errorlevel 1 echo %%x >> uneek.txt
)
echo Done. Results are in "uneek.txt".
Just tried it using the command:

uneek c:\windows\system32\drivers\etc\hosts

and it took it roughly 10 minutes on this aging laptop running XP Pro (w/all updates). The original HOSTS file contains 3,254 lines and UNEEK.BAT stripped out 26 duplicate lines.

The biggest reason for it taking so long is because it does NOT sort anything, (which could screw up the HOSTS file). It leaves everything as is and just searches for a duplicate line, a line at a time.

Note that your original file is NOT altered in any way. The output from UNEEK.BAT will always be in a file named UNEEK.TXT in your current directory (folder).
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP