Computer >> Computer tutorials >  >> Troubleshooting >> Windows Errors

Fix: ERR_ICAN_NAME_COLLISION

A name collision occurs when an attempt to resolve a name used in a private namespace, such as Top-Level Domain or unqualified name results in a query to the public Domain Name System (DNS). When the administrative boundaries of private and public namespaces overlap, name resolution may yield unintended or harmful results.

Fix: ERR_ICAN_NAME_COLLISION

What Causes the ERR_ICAN_NAME_COLLISION?

This can be caused because of the hostname mostly, but there can be other reasons which can arise in this issue, some of those are listed below.

  • Incorrect Syntax or Names: Some basic problems can be like the name of hosts file should be hosts and not host without any extensions with it. A single incorrect syntax can mess up your entire program.
  • White spaces: If the code is copied from somewhere, then there is a possibility that your code will end up with multiple spaces.
  • Permissions and Proxies: Sometimes there can be issues with the permission on the file or file attributes. If there is a proxy configured on the system, then It may bypass the hosts file. Using no proxy is a better option to get less issue.

Now that you have a basic understanding of the nature of the problem, we will move on towards the methods.

Method 1: Making Sure Your hosts File is Correct

Before you check problem elsewhere, make sure that the hosts file is working correctly. The basic correction about the hosts file will be:

  • The file name should be “hosts” and not host
    You can locate hosts file here:

    C:\Windows\System32\drivers\etc
    Fix: ERR_ICAN_NAME_COLLISION
  • There should be no extension for the hosts file
    Note: Make sure you check the extension, because windows have an option of hiding extensions in view tab
    You can find the view tab in file explorer’s menu bar

    Fix: ERR_ICAN_NAME_COLLISION
  • The syntax should be correct in the hosts file
  • Make sure you take care of all variants (www.example.com and example.com), sometimes one works but others won’t. Just add both to be safe.Fix: ERR_ICAN_NAME_COLLISION

You can check if the host file is working or not by typing the following commands in CMD (Admin Mode)

  1. Go to where CMD is, start menu or search in the search bar
    Note: For older windows, it will be: Start > All Programs > Accessories
  2. Right-click on CMD, select “Run as AdministratorFix: ERR_ICAN_NAME_COLLISION
  3. Type this command in cmd and enter:
    ipconfig /flushdns
    
    Fix: ERR_ICAN_NAME_COLLISION

    This will drop the old data records that may have been used.

  4. Now type the entry address that you added in your hosts file, to check if it uses the correct IP
    ping example.com –n 1
    ping -6 ipv6.example.com –n 1
    
    Fix: ERR_ICAN_NAME_COLLISION
  5. If the IP is correct, it means your hosts file is working fine and the problem is elsewhere
  6. But if the IP test fails, then you can reset the NetBios cache with typing this command in cmd (admin mode):
    nbtstat –r
  7. And you can check the current data in the DNS cache with the following command in cmd (normal mode):
    ipconfig /displaydns | more
    
    Fix: ERR_ICAN_NAME_COLLISION

Method 2: Checking for Whitespace

A single space even at the blank entry between two lines can mess things up. Notepad++ can help in showing the characters and inspecting the number of whitespace characters. If you copied the host entries from somewhere else, then there is the possibility of multiple spaces in it. To make sure the spaces don’t mess things up, just use spaces or tabs, not both and terminate the file with a blank line.

Method 3: Checking and Editing the Registry

You can find the key in registry editor which is specifying the location of the hosts file. You can check the entry in the key. If it wasn’t the correct one, then you can edit it. Also, for those who are missing the key in their registry or several other entries; they can create it or just copy it from other machines, that already have these.

  1. Open “Run” by pressing Windows + R keys
  2. Type regedit in it and enterFix: ERR_ICAN_NAME_COLLISION
  3. Now go to the following directory in Registry Editor:
    \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
    
    Fix: ERR_ICAN_NAME_COLLISION
  4. DataBasePath is the key that you will be checking, the entry in it should be:
    C:\\Windows\System32\drivers\etc

Method 4: Creating New hosts File with Default Permissions

The permission for the already available hosts file can have some issues. You can create the new one and copy the content of the existing one to the new one. The old hosts file will have the grey check marks, while the new will have black check marks. What this will do is, that the system will recreate the file with default permissions. To do so, follow the steps below:

  1. Create a new text file on Desktop
  2. Now open your “Notepad” as an administratorFix: ERR_ICAN_NAME_COLLISION
  3. Click File and then Open
  4. Then, go to the following address:
    C:\\Windows\System32\drivers\etc
  5. Locate the “hosts” file and open it, select all the text and copy itFix: ERR_ICAN_NAME_COLLISION
  6. And paste it into the text file that you created on the Desktop
  7. Rename it to “hosts” without any extensions
  8. Now this is a bit tricky step, you need to copy (do not move) the new hosts file to the existing one and overwrite it
    Note: For some users, copying worked and for some moving worked. First, try copying one.

If you are unable to read the existing old hosts file. You can do the following steps:

  1. Go to the following directory:
    C:\\Windows\System32\drivers\etc
  2. Right-click “hosts” file and select “Properties
  3. Now go into the “Security” tab
  4. In “Group or usernames” box, find the
    %COMPUTERNAME%\Users
    
    Fix: ERR_ICAN_NAME_COLLISION
  5. Check the permissions in below box and see if the user is allowed or not
  6. If the user is not allowed you can click “Edit” and there tick the following box for a user to allow:
    Read & Execute

    Fix: ERR_ICAN_NAME_COLLISION
  7. Then you will be able to edit the hosts file in notepad by opening it as administrator.

Method 5: Checking Proxy Issues

This method is about; if any proxy is configured on the system which might be bypassing the hosts file. In this method, we will check, if the system is running any proxy. We can check it on Internet Explorer by following steps:

  1. Hold the Windows Key and Press R. Type inetcpl.cpl and Click OK.
  2. Select the Connections tab and click on LAN settings
  3. Make sure the “Automatically detect settings” is checked, and the Proxy server is unticked. After checking the proxy settings, check if the issue is resolved.Fix: ERR_ICAN_NAME_COLLISION