Is it safe to have a DNS record pointing to 127.0.0.1?

Is it safe to do this?

I see no security problem with this.

Is there anything that can go wrong?

Possibly, though I am not sure I understood this correctly:
Has each developer their own development server and does each one work on their own local copy? Then this will work fine.

However if there is only one dev. server and you use this as your workstation then this might not work as expected since 127.0.0.1 is local host. As in each developers own localhost.

In ASCII graphics:

                                           Assigned IPs:
Your own computer                          127.0.0.1 
(with dev.server)         -----------      ::1
                                           'Normal' static or DHCP assigned IP


Other developers computer                  127.0.0.1
(Just a workstation)      -----------      ::1
                                           'Normal' static or DHCP assigned IP

If the other developer tries to access dev.mydomain.com then DNS will successfully translate that to 127.0.0.1. No need to add anything to the hosts file. But the other developer will not arrive at your dev. server. Localhost for him or her will be local.


A relevant security issue is the "same site scripting" described here: http://www.securityfocus.com/archive/1/486606/30/0/threaded

Although this issue is pretty old, some websites still make this mistake recently: https://hackerone.com/reports/1509


There is nothing security wise that would be a problem with this. It might block a valid domain name unless you are actually the owner of the domain, but it's a technique I've used for both development and sending ad servers DNS queries to invalid addresses.

As far as the potential side effects from a general networking standpoint, you'd probably want to ask on SuperUser or ServerFault.

Tags:

Dns