In this letter, we present an online learning mechanism called the dual integral learner for fast frequency adaptation in neural central pattern generator (CPG) based locomotion control of a hexapod robot. The mechanism works by modulating the CPG frequency through synaptic plasticity of the neural CPG network. The modulation is based on tracking error feedback between the CPG output and joint angle sensory feedback of the hexapod robot. As a result, the mechanism will always try to match the CPG frequency to the walking performance of the robot, thereby ensuring that the entire generated trajectory can be followed with low tracking error. Real robot experiments show that our mechanism can automatically generate a proper walking frequency for energy-efficient locomotion with respect to the robot body as well as being able to quickly adapt the frequency online within a few seconds to deal with external perturbations such as leg blocking and a variation in electrical power. These important features will allow a hexapod robot to be more robust and also extend its operating time. Finally, the generality of the mechanism is shown by successfully applying it to a compliant robotic manipulator arm called GummiArm.