Christopher's Broom Cupboard Rotating Header Image

Tiplet: Recovering a 'ghost' domain in DirectAdmin

I added a domain name to an account on one of my DirectAdmin-managed servers yesterday, and when I came to tweak some of its settings a few hours later it had mysteriously disappeared from the domains list in the control panel! (I think this was due to a dirty restart of the core DirectAdmin program, but I'm still not 100% sure). What was strange was that all the files (private and public_html) were still there if I FTPed in, the domain still resolved and loaded if I typed in its URL into a browser - but I couldn't access the control panel settings for it (so no email, no MySQL management etc). A crippled domain.

Even more frustratingly, attempting to rename/delete the domain's folder via FTP or SSH didn't work, and I couldn't re-add the domain to the account as DirectAdmin could (bizarrely) still see that it was already hosting it! Moving/deleting the domain's DNS zone file didn't work, and neither did a DirectAdmin restart. So, Catch 22... What to do?

I went digging into the server filesystem (using root) and had a look at some of the many catalogue files DirectAdmin uses to remind itself which domains it's hosting. I first checked for a .db file in /var/named/ (where the named DNS app stores its zone files for each domain) - the domain's file was still there. I then checked /etc/virtual/domains and /etc/virtual/domainowners (the first file holds a list of domains hosted on the system, and the second shows each domain's owner account), and for some reason while domains still had the problem domain listed, its ownership had disappeared from domainowners.

So, after readding it, saving the file out and restarting DirectAdmin via the control panel's Service Monitor (when logged in as admin), the domain immediately reappeared in the user's control panel and it's working perfectly once again. However, this would've been virtually impossible to fix had I not found some crucial info on the web, including John's post on Binary Web Host, where I first learnt of the existence of the domains and domainowners files.

Hopefully this helps other people avoid suffering this problem for long if they encounter it - I could find no useful info on the DirectAdmin knowledge base or forums, and it even had my server host stumped too (and they're no cowboys - they had never seen this problem before with DirectAdmin where it hadn't fixed itself after a restart).

One Comment

  1. [...] that domain, That domain already exists". DA is het domein dus niet helemaal kwijt. Ik heb de volgende oplossing al geprobeerd, maar het domein is gewoon aanwezig in de domainowners [...]

Leave a Reply