Residents were told to shelter inside as a raging bushfire put lives and homes at risk.