1. For an application operating on a host machine, a method comprising: receiving a plurality of database table entries for generating a configuration file for a Dynamic Host Configuration Protocol (DHCP) module executing within a virtualized container operating on the host machine; determining, based on a particular entry in the received database table entries, whether the virtualized container exists on the host machine; when the virtualized container is determined not to exist on the host machine: creating the virtualized container on the host machine; generating the configuration file for use by the DHCP module that executes in the virtualized container by (i) converting a first subset of the plurality of received database table entries that define a set of logical switches of a logical network for which DHCP service is provided into subnet data that is stored in the configuration file for use by the DHCP module and (ii) converting a second subset of the plurality of received database table entries that define machines connected to the logical switches into address bindings that are stored in the configuration file for use by the DHCP module; and initializing the DHCP module in the virtualized container, wherein the DHCP module reads the configuration file in order to provide DHCP service for the machines connected to the set of logical switches, wherein the machines connected to a particular one of the logical switches operate on a plurality of additional host machines and communicate with the DHCP module on the host machine.