<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<br>
<div class="moz-cite-prefix">On 04-Dec-22 21:34, vom513 wrote:<br>
</div>
<blockquote type="cite"
cite="mid:683C003E-E254-4740-957A-F47AC0E69472@gmail.com">
<pre class="moz-quote-pre" wrap="">Hello all,
So I set up parental-agents lists for my zones, and actually got to see it work (awesome !). bind detected the parent DS records and acted accordingly.
However, I currently have these lists configured using the IP (v4 only at the moment) addresses of the parent NS’es. I tried inputting hostnames, and I got errors (i.e. syntax) every time.
I would prefer to put these in as hostnames. While at a certain level in the tree these don’t change very often, they can and do. I’d rather not have to keep track of these in this manner.
So my question - am I just mangling the syntax - or does this clause really only support IPs ? I was thinking if so - perhaps the reason is some chicken vs. egg / security reason ? I.e. not trusting the name (which would have to be itself resolved) ?
Thanks in advance for clue++</pre>
</blockquote>
<p>Let the computer do the work.<br>
</p>
<p>Assuming you have a TRUSTED resolver, a work-around for this sort
of issue is to replace the definition with a 'include'.</p>
<p>Run a cron job that queries your resolver & writes the
resolved IP address . You can template the include file. (Or the
entire config, but I get confused when the main .conf file is
modified frequently.)</p>
<p>e.g. I use something like this in other cases. Season to taste.
Don't use 8.8.8.8...</p>
<p>include "myagents.conf"<br>
</p>
<p><code>myagents.conf.template</code></p>
<code>parental-agents port 99 { %host.example.com% key secret ;
%host.example.net% key sesame; }</code><code><br>
</code><code>parental-agents port 96 { %host.example.edu% key
password ; }</code><code><br>
</code><code><br>
</code><code>agent-update</code>
<p><code>#!/bin/bash<br>
<br>
# Update IP addresses<br>
<br>
IP4HOSTS="example.com example.edu"<br>
IP6HOSTS="example.net"<br>
<br>
TRUSTED="8.8.8.8"<br>
CONF="myagents.conf"<br>
<br>
trap "rm -f ${CONF}.tmp" EXIT<br>
if ! cp -p "${CONF}.template" "${CONF}.tmp" ; then<br>
exit 1<br>
fi<br>
<br>
function resolve () {<br>
local HOST="$1" TYPE="$2" IP=""<br>
if ! IP="$(dig +short "$HOST" "$TYPE" "@$TRUSTED")"; then<br>
echo "Failed to resolve \"${HOST}\" \"$TYPE\""
>&2<br>
exit 1<br>
fi<br>
if [ -z "$IP" ]; then<br>
echo "Failed to resolve \"${HOST}\" \"$TYPE\""
>&2<br>
exit 1<br>
fi<br>
sed -i "${CONF}.tmp" -e"s/%${HOST}%/${IP}/g"<br>
}<br>
<br>
for HOST in $IP4HOSTS; do<br>
resolve "$HOST" "a"<br>
done<br>
for HOST in $IP6HOSTS; do<br>
resolve "$HOST" "aaaa"<br>
done<br>
if ! mv "${CONF}.tmp" "${CONF}" ; then<br>
exit<br>
fi<br>
<br>
exit 0<br>
</code><br>
</p>
<pre class="moz-signature" cols="72">Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed.
</pre>
<br>
<div id="grammalecte_menu_main_button_shadow_host" style="width:
0px; height: 0px;"></div>
</body>
</html>