Removing double A Records (DNS)

Paul K

Verified User
Joined
Dec 1, 2011
Messages
22
When creating a new domain - all A records are double inserted both with the 2 SERVER ip's.
I like to remove this (not just for one, I want to disable this behavior on newly created domains).

Admin Tools -> IP Management says the 2nd IP is 'free'
'Show All Users' also shows only a single IP per user.

Any ideas?
 
Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d30
 
Everything is still the same? Any idea why it inserts a double A record everywhere?

I'm talking about this:

Code:
ftp	A	serverip1	
ftp	A	serverip2
localhost	A	127.0.0.1	
mail	A	serverip1		
mail	A	serverip2
pop	A	serverip1		
pop	A	serverip2


//If I do 'reset default' add the admin at the DNS zone it also produces the same thing.
 
Last edited:
What do you have in your dns templates in /usr/local/directadmin/data/templates or data/templates/custom

Check dns_a.conf
 
Default stuff

Code:
cat dns_a.conf
localhost=127.0.0.1
|*if IS_IPV6!="yes"|
|DOMAIN|.=|IP|
mail=|IP|
pop=|IP|
www=|IP|
ftp=|IP|
smtp=|IP|
|*endif|

I do not have any custom templates/scripts as well.

//Edit: I have now removed the IP completely at the Admin->IP Management (so doesn't ping as well anymore). However, the result is still the same. On which places are those config (regarding to IP) saved. Maybe I can try a search through all these files on IP?
 
Last edited:
Do you only see one ip listed for the user if you go to:

/usr/local/directadmin/data/users/<username>/ip.list
 
Do you only see one ip listed for the user if you go to:

/usr/local/directadmin/data/users/<username>/ip.list

Yes

Also did:

Code:
grep -R "ip2" * > /tmp/results.txt

in /usr/local/directadmin/

The only things it finds are all in httpd.conf
 
Yes running latest DirectAdmin. Going to try to grep -R on the full system to find any relations and will try to reboot the system. Is there any other location on DA that this could be saved to besides the filesystem?
 
All the directadmin configs are in /usr/local/directadmin. There is no database or anything.
 
Checked out the httpd.conf as well after creating a new domain - guess what - IP is also still in the vhosts. Is there a way to trace a domain creation to see which scripts get executed so I can maybe backstrace where the IP is coming from?
 
Well I just made a beginners mistake.... didn't read well...

At the 'IP Management' screen you could see nothing but if you clicked on the single ip / ip1 you get to that subpage.

In this list ip2 was linked - with Add to DNS and Add to Apache enabled.

Still wonder why I couldn't find anything in the config files :/

Might be a good feature request as well - to remove any "Linked IP's" when removing an IP address.
 
Hello,

I believe the system was coded to remove the linked IP, if you un-link the IP... But if you only remove the main IP from the User (the IP the linked IP is linked to), I'd have to check that out, as it may not know to remove the linked-IP.
I'll add a versions entry here and follow up when I know more.
http://www.directadmin.com/features.php?id=1458

John
 
Hello,

I've just looked at this issue, but wasn't able to reproduce it.
It's possible I've already fixed it in the code with some other change.. so try the pre-release binaries:
http://help.directadmin.com/item.php?id=408

Steps I used:

IP0: server IP, already on domain.
IP1: shared IP
IP2: free IP

IP2 is linked to IP1 with both apache and dns.

Assigned IP1 to a User, assigned it to a Domain, DNS enabled.
This added both IPs to dns.

I deleted IP1 from the domain (leaving only IP0)
Both IP1 and IP2 were removed from dns...


Note that IP2 is still linked to IP1 in Admin Level -> IP Manager.
If it's unlinked, it wouldn't work.

Also, if you've added IP2 to the domain as it's own IP, then it would stay there.
It's best not to actually use linked IP, other than with the linking system, to avoid that type of confusion.

Let me know if I'm missing anything.

John
 
I can't test it again on the same server - anyway I cannot remember how I did it as well.

I guess it was a very rare combination of the things I did that lead to this problem. I guess it can be closed :)
 
Sorry bring this old thread back, cause I got this problem also.

Any idea how to fix it?
Thank you...

I'm talking about this:

Code:
ftp	A	serverip1	
ftp	A	serverip2
localhost	A	127.0.0.1	
mail	A	serverip1		
mail	A	serverip2
pop	A	serverip1		
pop	A	serverip2
 
Hello Alex,

You can remove wrong records from a DNS zone at admin level in Directadmin. It's a DNS Administration page there.

If you get doubled records for a newly added domain, it might mean you have a linked IP, check a IP Management page at admin level in Directadmin. You might need to uncheck [_] Add to DNS option.

If you see a not-public IPs in a DNS zone and your server is behind a NAT, then probably you have it miss-configured, check a IP Management page at admin level in Directadmin. You might need to uncheck [_] Add to DNS option.
 
Hi zEitEr,

Yes, you're right.
I saw the second IP has [_] Add to DNS option checked.

I also saw that [_] Add to Apache option checked, do I have to uncheck too?

IP_Management_DA.jpg

Please see the attachment.

Thank you for your help ...

Hello Alex,

You can remove wrong records from a DNS zone at admin level in Directadmin. It's a DNS Administration page there.

If you get doubled records for a newly added domain, it might mean you have a linked IP, check a IP Management page at admin level in Directadmin. You might need to uncheck [_] Add to DNS option.

If you see a not-public IPs in a DNS zone and your server is behind a NAT, then probably you have it miss-configured, check a IP Management page at admin level in Directadmin. You might need to uncheck [_] Add to DNS option.
 
Back
Top