Sim, a edição do seu arquivo host deve ser suficiente.
Aqui está um exemplo do meu arquivo /etc/hosts
com domain.something
apontando para 127.0.0.1
127.0.0.1 localhost
127.0.1.1 My-Computer
127.0.0.1 domain.something
Agora, se eu executar ping domain.something
:
user@My-Computer:~$ ping domain.something
PING domain.something (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.021 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.053 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.022 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.044 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.023 ms
^C
--- domain.something ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.021/0.032/0.053/0.014 ms
domain.something
agora aponta de volta para localhost
.
Espero que isso ajude!