We demonstrate a combination of optical and electronic feedback that significantly narrows the linewidth of distributed Bragg reflector lasers (DBRs). We use optical feedback from a long external fiber path to reduce the high-frequency noise of the laser. An electro-optic modulator placed inside the optical feedback path allows us to apply electronic feedback to the laser frequency with very large bandwidth, enabling robust and stable locking to a reference cavity that suppresses low-frequency components of laser noise. The combination of optical and electronic feedback allows us to significantly lower the frequency noise power spectral density of the laser across all frequencies and narrow its linewidth from a free-running value of 1.1 MHz to a stabilized value of 1.9 kHz, limited by the detection system resolution. This approach enables the construction of robust lasers with sub-kHz linewidth based on DBRs across a broad range of wavelengths.