Koozali.org: home of the SME Server

Updating multiple Vitual Domains with yi.org

Offline arnoldob

  • *
  • 183
  • +0/-0
Updating multiple Vitual Domains with yi.org
« on: April 13, 2006, 12:40:01 AM »
I have several virtual domains running on a dynamic IP address. I have been using yi.org to update my primary domain for several years. Recently the ISP has been changing the dynamic IP address more frequently causing my virtual domains to fail until I noticed and manually update them at yi.og.

I was trying to come up with a simple way of updating all the domains.  I believe the relevant code is at:

/sbin/e-smith/dynamic-dns/yi  
Code: [Select]

#!/bin/sh
# Description: www.yi.org (free service)

#------------------------------------------------------------
# Send DNS IP address update to yi.org. Ignore DOMAIN
# parameter since yi.org only manages subdomains of yi.org.
#------------------------------------------------------------

IPADDR=$1
USERID=$2
PASSWD=$3
DOMAIN=$4

lynx -source -auth="$USERID:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR" | sed -e "s,^,$DATETIME: ," -e "s,<.*\?>,,g"


Yi.org uses the domain as the userid with the same password for each of the domains manged in my yi.org account. Do you think it's safe to copy this line and change the $USERID to the virtual domain name?:

Code: [Select]
lynx -source -auth="$USERID:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR" | sed -e "s,^,$DATETIME: ," -e "s,<.*\?>,,g"
 Also what is the "sed" command doing and is it needed after each of the virtual domain updates? The code change I'm considering would look like this:
Code: [Select]
#!/bin/sh
# Description: www.yi.org (free service)

#------------------------------------------------------------
# Send DNS IP address update to yi.org. Ignore DOMAIN
# parameter since yi.org only manages subdomains of yi.org.
#------------------------------------------------------------

IPADDR=$1
USERID=$2
PASSWD=$3
DOMAIN=$4

lynx -source -auth="$USERID:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR" | sed -e "s,^,$DATETIME: ," -e "s,<.*\?>,,g"
lynx -source -auth="virtual-domain1.com:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR"
lynx -source -auth="virtual-domain2.com:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR"
lynx -source -auth="virtual-domain3.com:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR"

I tested the lynx commands without the variables, hardcoding the values for the domains and password. Yi.org updates the time the domain was last changed correctly. Is there a better way to accomplish the updating of multiple virtual domains than my idea? Is the "sed" command needed for the virtual domain updates?

Thanks for Your Help
Tampa, FL USA

Offline arnoldob

  • *
  • 183
  • +0/-0
Updating multiple Vitual Domains with yi.org
« Reply #1 on: April 28, 2006, 02:01:16 PM »
Anyone have any input?
Tampa, FL USA

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Updating multiple Vitual Domains with yi.org
« Reply #2 on: April 28, 2006, 04:36:18 PM »
Quote from: "arnoldob"

I was trying to come up with a simple way of updating all the domains.


Configure all of your virtual domains with CNAME records pointing to the yi.org record which is being updated.

Offline arnoldob

  • *
  • 183
  • +0/-0
Updating multiple Vitual Domains with yi.org
« Reply #3 on: April 28, 2006, 09:45:24 PM »
Thanks for the reply Charlie, that did the trick!

 I also had to set up a host for www.yourvirtualdomain with a CNAME back to the primary domain. I wanted to remove the wild card A record that was pointed to the dynamic IP as well. All the www requests were going nowhere until I figured out what else was needed.

Thanks Again!
Arnoldo Bertoncini
Tampa, FL USA