Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

My dns zone contains a loopback:

localhost IN A 127.0.0.1

Do I need it, and if so why? I can't think of a reason to have it here, especially as - without a dot - it would be localhost.example.com

share|improve this question
    
Curious, I have the same on all my domains. I use a similar record to access my local test server... local IN A 192.168.1.13 - avoids the need to edit the local hosts file and works for all machines on the network. Is this related? –  w3d Dec 27 '12 at 15:56
    
Not in my case - we use example.local and example.internal as tlds - in the question localhost is a subdomain –  adam Dec 27 '12 at 16:07
1  
The same question was asked on ServerFault a while back: serverfault.com/questions/120769/localhost-in-a-dns-zone –  w3d Dec 27 '12 at 17:50

2 Answers 2

up vote 1 down vote accepted

This answer on ServerFault explains what this localhost entry is for http://serverfault.com/questions/120769/localhost-in-a-dns-zone

localhost.example.com is sometimes included on internal DNS servers to prevent "localhost" requests leaking out to the internet (for the case where John Smith types http://localhost/ in his browser & for whatever reason his resolver doesn't look in the hosts file, appends his search path (example.com) & starts asking name servers what that resolves to).

It also talks about the possibility that such a DNS record could be use for Cross Site Scripting (XSS) attacks and suggest removing it for that reason.

share|improve this answer
    
Thanks @Stephen, that's great! –  adam Feb 25 '13 at 15:58

Did your DNS undergo testing because a many times loopback entry tests ability to process Web requests without actually sending any messages out. I believe it is not needed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.