Current treatments for pain often have moderate efficacy and cause unwanted effects, highlighting the urgent need to develop more effective therapeutic strategies. Accumulating evidence suggests that histone acetylation plays essential roles in acute and chronic pain. Pharmacological inhibition of HDAC6 has emerged as a promising therapeutic approach for pain management. Herein, we report the design, synthesis, and characterization of a series of diphenyl-1,2,4-oxadiazole analogues, which exhibit good selectivity and potent inhibitory activity against HDAC6. Among the new analogues, compounds 13 and 36 showed potent inhibitory activities against HDAC6 with IC50 values of 12.5 and 8.5 nM, respectively, along with good selectivity over other HDAC isoforms. Both compounds significantly alleviate analgesic effects on sensory hypersensitivity behaviors in the carrageenan-induced inflammatory pain model (ED50 = 31.62 and 37.89 mg/kg, respectively) and the paclitaxel-induced neuropathic pain model (ED50 = 45.76 and 35.66 mg/kg, respectively). Furthermore, compound 36 suppressed the lipopolysaccharides (LPS)-induced microglia activation by inhibiting the levels of key pro-inflammatory cytokines (iNOS, COX-2, TNF-α and IL-6) in BV2 microglial cells. Compound 36 also demonstrated moderate oral bioavailability and favorable motor function safety. Together, these findings highlight compound 36 as a promising lead compound for further pharmacophore optimization, thereby paving the way for the development of selective HDAC6 inhibitors as a viable therapeutic strategy for the treatment of mechanical allodynia.