domains missing from /etc/virtual/domains

hostpc.com

Verified User
Joined
Aug 2, 2003
Messages
1,178
Location
Schenectady, NY
Ok, here's an interesting one for the tech heads. I've been beating myself up for 2hrs on this and cant crack the nut.

(cent os5.2)

Follow me on this one:

cat /etc/virtual/domains - and get a list of all domains on the system, right?

login to DA - show all users - and their domains, right?

cat /usr/local/directadmin/data/users/*/domains.list - and see all of their domains, right?

cat /usr/local/directadmin/data/users/*/httpd.conf |grep ServerName - and see all their domains, right?


wrong.


A customer is experiencing a wholesale loss of domains from /etc/virtual/domains - they're just not there, but they do exist in every other location on the server. Customer hasn't edited the file - they can't. File isn't immotable (cant be anyway). They're just not showing up.

Anyone ever seen this before? I've dissected the DA scripts - I can't find anything that would regenerate the domains list.

I could do it manually with a few waves of my perl / grep scripts and a friends carefully crafted "for i" scripts, but I really want to know how they SHOULD be replaced, what implications there are of the domains missing from there, and most importantly, why they're not showing in the first place.


Now, to qualify - customer has no root access to this server. It hasn't been compromised, it's a new install (less than 6 weeks), all versions are up to date and nobody has touched it other than myself (and I sure as hell didn't modify one file just to test myself) :)

Any ideas?
 
Actually, if a mod sees this, it should probably be in "
System-Level Technical Discussion"

I've already emailed DA tech support about it - maybe they've got ideas, but I'd love to hear from the community about anything they can suggest.

Thanks
 
Further, the directory and file permissions:

drwxr-xr-x 7 mail mail 4096 Feb 3 12:02 virtual

-rw-r--r-- 1 mail mail 61 Jan 30 08:58 domains

do those CHMOD values seem correct?
 
Reply from DA Support:
You can redump the file with this:
http://help.directadmin.com/item.php?id=113

Also check domainowners, as often the go hand-in-hand:
http://help.directadmin.com/item.php?id=43

If you get many users trying to write to the same file at the same time, eventually the locking will just give up and generate an error for them.
They could delete the domain and try again when it's less busy (we're talking milliseconds of locking time)... or just tell their admin it's not working ;)




Thanks guys, I've never heard of this before, glad it was already addressed. Somehow I missed it in the help section. (maybe I didn't look back far enough)
 
Reply from DA Support:
You can redump the file with this:
http://help.directadmin.com/item.php?id=113
...
Thanks guys, I've never heard of this before, glad it was already addressed. Somehow I missed it in the help section. (maybe I didn't look back far enough)
Actually, it's a terrible idea unless all domains on your server host mails locally (that is, on the server). If some domains use Google App or some other external mailservers, they will start losing mail generated from the website (contact us forms, order confirmations etc) because your server won't obey MX records.

For generic solution you will have to figure out what domains should be "local" as follows:
1. Run DNS query for MX record of all domains on the server
2. Obtain IP address from the MX record
2. match MX record's IPs with your server's IP
If there is a match, the domain should be local (that is, added to /etc/virtual/domains file).
 
If the customer has access to mx records then if they uncheck "Use this server to handle my emails." then it will be deleted from the /etc/virtual/domains file and nowhere else. If its only happening to one client then that is what I would suspect.
 
  • Like
Reactions: Kal
If the customer has access to mx records then if they uncheck "Use this server to handle my emails." then it will be deleted from the /etc/virtual/domains file and nowhere else. If its only happening to one client then that is what I would suspect.
We were discussing a scenario where /etc/virtual/domains file got corrupted and had to be regenerated. Of course it affects all domains on the server, not just 1 customer or 1 domain.
Any domain might or might not host mail locally and figuring out what domains should be added to /etc/virtual/domains is time consuming because /usr/local/directadmin/data/users/USERNAME/user.conf files do not contain this information (DA does not store this information in user profiles and solely relies on the content of /etc/virtual/domains file).
Therefore, the only reliable way of figuring this out would be querying nameservers.
 
We were discussing a scenario where /etc/virtual/domains file got corrupted and had to be regenerated.

Really?? Because that is not what Joe said. He never said the file was corrupted. He domains were missing from "a customer" which indicates one. If the file was corrupt then it would likely affect more than one customer.

hostpc.com said:
A customer is experiencing a wholesale loss of domains from /etc/virtual/domains - they're just not there, but they do exist in every other location on the server. Customer hasn't edited the file - they can't. File isn't immotable (cant be anyway). They're just not showing up.

Joe said "A customer" as in one, one customer. I explained how that could happen to one customer. My comment was a supporting comment what what YOU said. So I don't know why you are disagreeing with me.

I believe Joe would like to know 2 things:

1. Why it happened.
2. How to fix it.

I commented on why it "could" have happened.

Webcart said:
Therefore, the only reliable way of figuring this out would be querying nameservers.

Absolutely true. That tells one how to fix it. But it does not address how the domains became "missing" to begin with which is what I was doing.

Don't confusing why something happened with what the fix is. They are two different things.
 
We were discussing a scenario where /etc/virtual/domains file got corrupted and had to be regenerated.
Really?? Because that is not what Joe said. He never said the file was corrupted. He domains were missing from "a customer" which indicates one. If the file was corrupt then it would likely affect more than one customer.
If you take a closer look at my original post, you will notice I quoted a HOWTO about rebuilding empty /etc/virtual/domains file and offered my comments in regards to this specific HOWTO.

My comment was a supporting comment what what YOU said. So I don't know why you are disagreeing with me.
Well, I never said I disagreed with what you said :)
You just didn't indicate what post you were replying to, so I thought I would provide little mroe clarification on what I was talking about.
 
Maybe its my mistake. I thought you were indicating that my post was out of place.
 
Back
Top