Catalyzes the omega- and (omega-1)-hydroxylation of saturated fatty acids and n-alkanes (By similarity). Also bioactivates xenobiotics such as the procarcinogen 3-methoxy-4-aminoazobenzene and the cyclic arylamines 2-aminofluorene and 2-aminoanthracene (By similarity). In addition, catalyzes O-dealkylation of 7-ethoxycoumarin (By similarity). Functions at the interface of xenobiotic and endobiotic metabolism, contributing both to fatty acid and hydrocarbon oxidation and to the bioactivation of diverse xenobiotics. Preferentially hydroxylates the terminal carbon (omega-hydroxylation) of medium-chain fatty acids (C8-C10), with regioselectivity decreasing as chain length increases. C8 fatty acids and C7 n-alkanes display optimal chain length for regioselective omega-hydroxylation, and n- alkanes (C7-C10) are generally turned over faster and with higher regioselectivity than the corresponding fatty acids. In addition to omega/omega-1 hydroxylation, also catalyzes alpha-, beta-, gamma- and delta-hydroxylation of mid-chain length fatty acids, whereas fatty alcohols of the same chain length are almost exclusively hydroxylated at the omega, omega-1 and omega-2 positions (By similarity). {ECO:0000250|UniProtKB:P15128, ECO:0000250|UniProtKB:P15129, ECO:0000250|UniProtKB:Q64462}. This is the function of CYP4B1 (cytochrome P450 family 4 subfamily B member 1, Ensembl gene identifier ENSG00000142973).