It helps to know what denatured alcohol is called in your part of the world and what the denaturants are. e.g. in many EU countries, its required to have blue or purple dye in it + other objectionable chemicals from our point of view. In English speaking countries, the result is commonly known as "Methylated Spirits" (colloquially "Meths"). However in France their "Alcool à brûler" (alcohol stove fuel) is ethanol denatured with methanol and isopropanol with no legal requirement to dye it. Its also about half the price of Meths in the UK at 2 to 3 Euro/L.
A small amount of water in the alcohol is not a problem when making flux. Colophony (Rosin) is only slightly soluable in water and you will get a murky milky layer settling out at the bottom containing nearly all the water. As I said earlier, decant the good clear flux off the top, and you leave the water behind..
However if you do need very dry alcohol, any reasonably dry alcohol or blend of alcohols can be dried with anhydrous Calcium oxide to produce absolute alcohol (99.5% alcohol, 0.5% water). Anhydrous Calcium oxide is commonly known as "quicklime" which can be produced by heating natural chalk (not blackboard chalk), or white marble or white fine grained limestone to red heat and holding that temperature for at least five minutes. Quicklime is highly caustic and a severe skin contact and inhalation hazard and its reaction with water is highly exothermic so you'd better know what you are doing before even considering making it.
Add the granular or powdery quicklime *SLOWLY* to the alcohol, monitoring the flask temperature and allowing it to cool as required. Agitate several times then seal and let it stand several days till as much of the solids as possible have settled out. Decant and filter to remove the rest.
Calcium and magnesium hydroxides are generally reckoned to be insoluble in alcohol so the resulting alcohol will be dry and acceptably pure. It can be tested for water content using freshly dried Cobolt chloride paper, which should stay blue.
Alcohol can also be dried with salts, including common salt (Sodium chloride) which dissolve in the water to form an immiscable layer that can be separated from the alcohol. However I don't want my flux or boards contaminated with traces of chlorides or sulphates so even though its a lot easier and safer I don't suggest that.