Reading through aolserver docs, I was able to learn what ns_info
does, but not how it does it.
For now this is what my "homework" on this subject looks like: my
best guess so far was that for hostname and address it goes to
/etc/hosts. I have tried to modify localdomain (in etc/hosts) to
something like lokaldomein expecting for [ns_info hostname] to come
up with the modified entry. It retrieved localhost.localdomain
as
it was before modification, but [ns_info address] returned nothing.
So I am not so sure about hosts anymore
Taking advice from a previous
post , I used this script, to check what ns_info was returning:
ns_return 200 text/plain "hostname: [ns_info hostname]
address: [ns_info address]
file: [ns_info config]
David Walker suggested a script for setting address in nsd.tcl to
the ppp0 (eth0 in his case) address. I modified so it worked with my
setup. This is the relevant
section of my nsd.tcl file:
# the script takes the ip address from ppp0 and returns it as the
variable address
set hostname bradut.com
set varawk {{print $2}}
set varsed {-e s/.*://}
set address [exec /sbin/ifconfig ppp0 | grep addr |
awk $varawk | sed $varsed]
In this way, every time my ip changes nsd.tcl automatically changes
its setting; ddclient also takes care of the dns records on dyndns
server, so my hosting setup via adsl with dynamic ip seems to be
ok.
However, I am not sure wether what I've done is the most elegant way
of solving this problem of changing ip. So I would like to know
whether there is a way to specify in whatever conf file ns_info
uses to get its hostname and address from, that the ip address for
my server is the ppp0 address and the hostname is myhostname.
Thank you all very much for all your help so far.