Aflatoxin B1 is a mycotoxin produced by the fungus Aspergillus that contaminates food, notably grains and peanuts. Aflatoxin B1 is hepatotoxic, causing necrosis, and cirrhosis, and is classified as an hepatocarcinogen. Traditional methods for detecting aflatoxin B1 such as thin-layer chromatography, high-performance liquid chromatography, enzyme-linked immunoassay, and liquid chromatography-tandem mass spectrometry, have limitations including high costs, complex preparation procedures, and occasionally low sensitivity. Here, we review DNA-based biosensors for aflatoxin B1 detection with emphasis on electrochemical and optical sensors. Electrochemical biosensors are based on electrochemical impedance spectroscopy, amperometry, voltammetry, and potentiometry. Optical sensors involve colorimetry, surface plasmon resonance, fluorescence, and electrochemiluminescence. Sensors combine nano and composite materials, such as gold nanoparticles, black phosphorus nanosheets, graphene oxide, niobium carbide, photonic crystals, and liquid crystals. DNA-based biosensors, such as aptamer biosensors, are efficient, rapid, sensitive, affordable, and selective to detecting contaminants and pathogens.