Auto add IPv6 and IPv4 addresses to both user and domain

petervdbroek

New member
Joined
Jul 25, 2012
Messages
1
When I add a new user to directadmin (API or via control panel) and assign domains to the user I have 2 manually add my IPv6 address to the user and add the IPv6 address to the domains I just added.

Is there a way the IPv6 address will be added automatically to both user and all the domains I create?

I already searched the forums but couldn't find anything, I think I have to change the templates but can't find which one.

Thanks for your help.
 
Did anyone make any progress on this? I used this script to add the ipv6 to all my users:

Code:
#!/bin/sh

#Set the IP here, it could be either IPv4 or IPv6
IP="2a02:348:58:556e:0:0:0:1"

#Does the IP address exist?
COUNT_IP="`grep -c \'${IP}\' /usr/local/directadmin/data/users/admin/ip.list`"

#if [ ${COUNT_IP} -eq 0 ]; then
#   echo "IP ${IP} does not exist. Exiting..."
#   exit 1;
#fi

for user in `ls /usr/local/directadmin/data/users`; do
{
   echo "Adding ${IP} to /usr/local/directadmin/data/users/$user/user_ip.list..."
   echo "${IP}" >> /usr/local/directadmin/data/users/$user/user_ip.list
   for domain in `cat /usr/local/directadmin/data/users/$user/domains.list`; do
   {
        if [ -e /usr/local/directadmin/data/users/$user/domains/$domain.ip_list ]; then
            echo "Adding ${IP} to /usr/local/directadmin/data/users/$user/domains/$domain.ip_list..."
        echo "${IP}" >> /usr/local/directadmin/data/users/$user/domains/$domain.ip_list
        fi
   }
   done;
}
done;

exit 0;

I guess the solution can be found in combining this code with the domain_create_post.sh and user_create_post.sh. Though, that is a little to complex for me. Anyone who knows what needs to be done?
 
Actually how I am managing IPv6 on directadmin is as follows.
I do add the IP in directadmin, but it stays marked as free.

I am changing all templates, httpd template and named template to add the ipv6 address.
in the httpd template i am adding the ip in the virtualhost
and the same for named.

However the only donwside of this config is that if a user adds a subdomain, the AAAA record is not created in named,
and I cant find the template for this...

So actually i'm not adding each time the ipv6 address to each user in directadmin,
because even resellers are using the webserver, and I dont want them to worry about this.
and because its a timeconsuming job to add the ipv6 address everytime again.

The only thing I am missing here is the named template for a subdomain.
 
Back
Top