Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


hostname | 5 comments | Create New Account
Click here to return to the 'hostname' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
hostname
Authored by: synathome on Nov 11, '02 07:41:17AM

I can't really say whether or not this will work for you (I don't have a LAN with NAT), but you might try setting the hostname from the command line ("sudo hostname mysite.dnsalias.com") to achieve the same result. Making the change at this "central point" might mean that other apps or utilities can take advantage of it (e.g., I used it for ssh-keygen).

If you use a utility such as DNSUpdate, you should be able to add the command to its StartupItem (/Library/StartupItems/DNSUpdate/DNSUpdate):

[...]

ConsoleMessage "Starting DNS Update"

nohup /usr/local/sbin/dnsupdate daemon > /var/log/dnsupdate.log 2>&1 &
/bin/chmod 664 /var/log/dnsupdate.log
/usr/bin/chgrp admin /var/log/dnsupdate.log

ConsoleMessage "Setting hostname"

hostname mysite.dnsalias.com

[...]

There is probably a much better place to store the hostname than in the startup item. I have also considered adding this functionality to the DNSUpdate utility (thank you for making it open source, Julien) but a.) it would require a UI change so that the user could decide which of h/er incoming hostnames would be used as the outgoing one, and b.) it may be a bad idea for some reason I don't know about.

Thoughts, anyone?



[ Reply to This | # ]