Not sure if it works on ants, but on much smaller insects it does. They use it as a natural insecticide for fleas. It dries out their body.
If you use it internally, make sure you buy food grade and do not inhale it. They sell pills as well just google it.