I know that magnetism is due to the alignment of domains of a magnetic substance. Due to this reason, an iron bar may be magnetized by stroking it with a permanent magnet such that its domains are aligned. Similarly, when a wire is coiled around a soft iron core and current flows through it, the iron core starts behaving as a magnet as it's domains are aligned.
My question is that why does the iron core lose its magnetic properties once the current flowing through the coil is stopped. Shouldn't the domains that were aligned remain aligned?
There might be a flaw in my reasoning too, so please tell me where I'm going wrong with this concept.