Optical second-harmonic ͑SH͒ response of a semiconductor quantum dot ͑QD͒ excited by the near field of a tip in a near-field scanning-optical microscope is investigated theoretically. Using an anisotropic effectivemass approximation, we analyze the frequency-and space-dependent SH nonlinear current density in the midgap frequency region associated with interband and intersubband transitions in the QD system. Both heavyand light-hole states contribute to the SH signal of the QD system. Assuming that an external field drives the tip and the tip field excites the QD, and neglecting local-field effects, we define an effective SH susceptibility tensor of the QD/tip system in terms of the incident-external field. The second-harmonic generation is allowed because the rapidly varying tip field excites the selection-rule breaking transitions in the QD system. For a given size of the metal-coated tip, we performed numerical calculations of the SH susceptibility by scanning the tip and varying the frequency. We show that the SH nonlinearity of the QD/tip system is strongly dependent on the tip position because the overlap integral of the QD envelope wave functions and the tip field is varied by scanning the tip over the QD. Our results also show that the spatial distribution of the tip field is reflected in the tip-position dependence of the SH signal. ͓S0163-1829͑99͒07103-9͔