Certain zoning ordinances were enacted by tbe city council of tbe city of Durham and became effective on 18 May, 1926. Under these ordinances certain residence zones, business zones, and industrial zones were designated and set apart for tbe purposes therein set forth. The following is a part of section 1: “No building or premises shall be erected, altered or used for any other purpose than a purpose permitted in the zone in which such building shall be erected, except in conformity with the regulations herein prescribed for the zone in which such building is located.” Section 2 permits in the residence zones the erection of certain buildings therein described and in effect prohibits the erection therein of buildings of any other class. The building erected by the defendant is not one of those permitted by this section. Section 5 of the Building Code, which went into effect 1 November, 1925, provides that the erection, construction or alteration of any building, structure or part thereof shall not be commenced until a written permit is issued, and that the work shall strictly conform to the application and plans; also that the inspector of buildings shall have power to revoke any permit in case of a false statement or misrepresentation of any material fact relating to the erection, alteration or removal of a building. Section 10 is as follows: “Upon completion of any new building, structure or alteration to any building or structure, provided no violation of this code exist, the inspector of buildings shall issue to the owner a certificate of occupancy of the building or part thereof, showing that the provisions of this code have been complied with, and no building can be occupied until such certificate has been issued.”
The defendant erected a store and automobile service station near the eastern corporate limits of the city in one of the B residence zones. Before doing so he applied to the building inspector for a permit, which was refused. He then appealed from the building inspector’s decision to the board of adjustment, and the board sustained the inspector’s ruling and denied the defendant’s application. The defendant thereafter completed and operated his store and filling station without having a permit. A warrant was issued from the recorder’s court charging the defendant with a breach of the zoning ordinances and the building code. The defendant assailed the ordinance on the ground that it is unreasonable and unconstitutional. He offered to show that within the radius of a quarter of a. mile from his premises there is only one store and no filling *72station; that with the exception of another building there is neither a store nor a filling station within a radius of a half-mile; and that there are only three other business places within three-quarters of a mile from his property. This evidence was excluded, and the jury were instructed to return a verdict of guilty if they found the facts to be as shown by all the evidence. The question is whether there is error in this instruction.
The exclusion of the evidence must be approved for the reason that the defendant by failing to pursue his statutory remedy is precluded from attaching the ordinance collaterally upon the ground which he assigns.
Zoning ordinances are of comparatively recent origin. Only a few years ago it would generally have been conceded that the courts would not sustain an ordinance excluding all business buildings from a residence district, but in more recent decisions the zoning power of municipal corporations is recognized and upheld. Such ordinances are usually enacted in pursuance of legislative power conferred upon cities and towns on the theory of promoting the public health, the public safety and the public welfare, when they are reasonable and free from discrimination. Berger v. Smith, 160 N. C., 205; S. c., 156 N. C., 323; Small v. Edenton, 146 N. C., 527; Annotation, 19 A. L. R., 1395; State ex rel. Civello v. New Orleans, 33 A. L. R., 260; Biller v. Board of Public Works, 38 A. L. R., 1479; Annotation, 43 A. L. R., 668; Gorieb v. Fox, 274 U. S., 603, 71 Law Ed., 1228; Nectow v. Cambridge, 277 U. S., 183, 72 Law Ed., 842.
Our statute law with respect to zoning regulations is embraced in C. S., 2776(r) et seq. Section 2776 (x) provides for the appointment of a board of adjustment, who shall hear and decide appeals from and review any order, requirement, decision, or determination made by an administrative official charged with the enforcement of any ordinance adopted pursuant to the act. It further provides that every decision of the board shall be subject to review by proceedings in the nature of certiorari. The statute thus confers upon the board the right to exercise the functions and powers of a quasi-judicial body. This is the Court’s conclusion as stated in Harden v. Raleigh, 192 N. C., 395, and in Little v. Raleigh, 195 N. C., 793.
When in the case before us the building inspector’s decision was affirmed by the board of adjustment the defendant should have sought a remedy by proceedings in the nature of certiorari for the purpose of having the validity of the ordinances finally determined in the Superior Court, and if necessary by appeal to the Supreme Court. This he failed to do and left effective the adjudication of the board of adjustment. The board’s judgment is not subject to collateral attack. As was said in S. v. Kirkpatrick, 179 N. C., 747, 750, “He (the defendant) has taken *73tbe law in bis own bands and adjudged tbat tbe ordinance is invalid, or tbat for some reason, wbicb is not stated, be is exempt from its. authority.” Of similar import is tbe decision in Manufacturing Co. v. Commissioners of Pender, 196 N. C., 744.