No, not all cast-iron pans have a magnetic base. The magnetic properties of a cast-iron pan depend on the type of material used to make it. Traditional cast-iron pans, which are made primarily from iron and carbon, are generally magnetic. Most cast-iron pans you'll find on the market are of this type and will have a magnetic base.
However, some modern variations of cast-iron pans may have additional coatings or layers that could impact their magnetic properties. For example, enameled cast-iron pans have a layer of enamel coating on the surface, and the magnetic properties might be affected by this coating. While they may still be partially magnetic due to the iron core, the magnetic pull might not be as strong as in traditional cast-iron pans.
If you specifically need a magnetic base for induction cooking, it's essential to check the manufacturer's specifications and confirm that the cast-iron pan you are considering is compatible with induction cooktops. Some cast-iron pans are designed with a flat magnetic base specifically for use with induction cooking surfaces, while others may not be suitable.