Trailing "." on local hostname?

michaelsanford

Translator, Web Developer
In the Sharing control panel, I've configured the Rendezvous Name (i.e., $HOST) to "amras.no-ip"

It then appends .local to the end.

What I can't understand is why it then adds another "." after local, to get the whole name as "amras.no-ip.local."

A) Why does it do that?
B) How can I prevent that (since I have %M in my shell prompt followed by a colon, it looks awkward as "[amras.no-ip.com.:~]% "

:p
 
In DNS-speak '.' has a special meaning. It means 'root domain'. Implicit to all DNS queries is the trailing dot. Even though you don't typically see it, a DNS query for this site would actually be 'www.macosx.com.' meaning that there are no higher authorities beyond the root name servers that control what is in the domain 'com'.

For DNS-formatted queries against '.local' to work correctly, all applications would need to know not to query beyond '.local'. Some browsers, for instance, would try to be clever and query for 'myserver.local.com', for instance, and you'd never find the machine on your local network. Adding the trailing dot 'forces' the client application to submit the name query 'as is' to the dns resolver. In the case of rendezvous, that would be the mDNS services which do a DNS-formatted lookup over multicast.

For more gorey details see Stuart Cheshire's draft RFC. He doesn't talk very much about client application behaviour, though, but does talk about the .local. name and how it must be handled in Rendezvous/ZeroConf. Additional information is available through the ZeroConf website.

I hope that answers "why is it there"...

I don't quite know how to get rid of it in the prompt, aside from some clever string-slicing, which I doubt csh is up for anyway. I'm guessing that %m is insufficient, since it would also drop the '.noip' portion of your address?

I'll keep playing with it, and if I come up with something, I'll post here again...
 
Back
Top