-1

I made this entry in my C:\windows\system32\drivers\etc\hosts file:

convert2mp3.net     convert2mp3.com

so that my browser always calls convert2mp3.net instead of convert2mp3.com if i accidentially call convert2mp3.com

But it does not work. I also flushed the DNS cache by executing ipconfig /flushdns in the CMD. I also tried to use another browser but still no redirect.

What am I doing wrong?

Black
  • 18,150
  • 39
  • 158
  • 271

2 Answers2

2

The /etc/host file is used to force the resolution of a domain to a specified IP Address. Your line is missing the ip Address help for win7

It should be:

127.0.0.1    mywebsite
Ayak973
  • 468
  • 1
  • 6
  • 23
1

You cannot change DNS names like that, especially not in an HTTP context.

So the problem is you sometimes type a .com address in your browser where the site you want to go to actually is at the same address - only ending in ".net".

Even if you could change the hosts file to let the .com address point to the .net server's address, the request is likely to return an error, because their server isn't configured to handle requests to the .com address, which your browser will still send as a host header.

So create a bookmark in your browser and click that, instead of typing DNS addresses yourself if you're making that mistake that often.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272