Edit the host file on Mac Os and Windows. Designers Special

Learning how to edit the host file on Mac Os and Windows is essential for developers, implementers, and web designers.

For example, it is very useful when we migrate from one server to another without changing the DNS of the domain and we want to know if the migration has been successful.

Another useful example is when we are working on another server to make a new website without affecting the current website and without having to make changes to dns or nameservers.

Many of our clients use this technique for example when they migrate from another provider and can make the necessary checks and changes on the new server before permanently changing the DNS of the domain so that it points to their new server with Host-Fusion.Com

For this, it is necessary to edit the host file of our computers to indicate that a domain must point to a specific IP, it is practically like “fooling” our computer to make it believe where the web with which we want to work is located, which makes it easier for us the task as a designer, implementer or programmer without putting the web or web mails in production at risk.

Whether we are Mac Os or Windows users, we can do it easily by following a series of steps, these changes can always be reversed so it does not pose any danger to the web or computer.

As a security measure it is also useful but today it is about designers, programmers and implementers.

Edit the host file on Mac Os

In the case of working with Mac OS, MacBook, iMac systems, we have to do it with the Terminal of our computer.

Mac Os terminal

We can access in several ways, Launchpad and in the other folder we have access to the Terminal, also using the Mac search engine and typing Terminal or by opening Applications / Utilities in the Finder we can find the Terminal.

We open the terminal and we must type the following command:

sudo nano /private/etc/hosts

It will not ask for the administrator password, we introduce it to be able to access the host file that should be like the following image

archivo host Mac Os

The next step is to add the ip and the domain name with and without 3 W to the host file as you can see in the following image

add ip and domain to host file

Now we just have to save the changes by pressing Control + O (the letter) and Enter and to close Control + X.

From now on we will see the domain pointing to that IP, BEWARE only on our computer.

When we have finished the work, we can always delete the lines and save changes as indicated above.

Edit the host file in Windows

To edit the host file in Windows we must enter as administrator, in this way we can access the host file of our Windows in the following path

C:WINDOWSsystem32driversetchosts

Something similar to this should appear, in Spanish or English

—————————————————————————-
# Copyright (c) 1993-1999 Microsoft Corp.
#
# Éste es un ejemplo de archivo HOSTS usado por Microsoft TCP/IP para Windows.
# Este archivo contiene las asignaciones de las direcciones IP a los nombres de
# host. Cada entrada debe permanecer en una línea individual. La dirección IP
# debe ponerse en la primera columna, seguida del nombre de host correspondiente.
# La dirección IP y el nombre de host deben separarse con al menos un espacio.
#
# También pueden insertarse comentarios (como éste) en líneas individuales
# o a continuación del nombre de equipo indicándolos con el símbolo «#»
#
# Por ejemplo:
#
# 102.54.94.97 rhino.acme.com # servidor origen
# 38.25.63.10 x.acme.com # host cliente x
127.0.0.1 localhost

We must copy the content of the file and paste it in the notepad for example on the desktop, since Windows if we edit the host file directly will deny us access, so we better copy and edit in the notepad so that once finished, replace the host file for ours, at this time will be when Windows asks us for administrator permissions to accept the changes and replace.

As in Mac Os the lines to add are the same, ip and domain name

# Copyright (c) 1993-1999 Microsoft Corp.
#
# Éste es un ejemplo de archivo HOSTS usado por Microsoft TCP/IP para Windows.
# Este archivo contiene las asignaciones de las direcciones IP a los nombres de
# host. Cada entrada debe permanecer en una línea individual. La dirección IP
# debe ponerse en la primera columna, seguida del nombre de host correspondiente.
# La dirección IP y el nombre de host deben separarse con al menos un espacio.
#
# También pueden insertarse comentarios (como éste) en líneas individuales
# o a continuación del nombre de equipo indicándolos con el símbolo «#»
#
# Por ejemplo:
#
# 102.54.94.97 rhino.acme.com # servidor origen
# 38.25.63.10 x.acme.com # host cliente x
127.0.0.1 localhost

72.249.xxx.xxx nombrededominio.com www.nombrededominio.com

When we finish our work we can always go back to edit the file following the previous steps and eliminate those lines.

Conclusions.

Although at first it seems a bit complicated and gives the impression that “touching” the host file of our computer is reckless, following these steps everything will go smoothly and it will provide all of you who dedicate yourself to web design, programming, implementers and other web professionals, a very comfortable way to work on projects without the need to make DNS changes and with the guarantee of knowing that everything works correctly before making that change.

Once you try to change the host of your computer to work, there is no going back, all are advantages, it will be essential for your work, guaranteed.

Your WooCommerce store is not even on pedals?

That is because it is not in a hosting designed and designed so that your online store works as you and your customers need, stop losing money and customers and go to a real WooCommerce hosting.