1. For a network controller for managing a set of hosts, a method for configuring a physical machine to provide Dynamic Host Configuration Protocol (DHCP) service, the method comprising: configuring a DHCP module in a first physical machine to provide DHCP service for a plurality of logical networks by providing network addresses to machines belonging to the plurality of logical networks, wherein each logical network comprises a logical router having logical ports to which the network addresses provided for the machines of the logical network map, each logical network logically connecting a set of machines operating on a plurality of host machines, wherein the set of machines of a first logical network are isolated from the sets of machines of the other logical networks; configuring a first managed forwarding element (MFE) operating in the first physical machine to (i) forward to the DHCP module requests to obtain network addresses, received from a plurality of other MFEs, for machines of the plurality of logical networks, and (ii) forward data packets for the plurality of logical networks; and configuring a second MFE operating in a second physical machine to (i) forward to the first MFE requests to obtain network addresses received by the second MFE from a set of machines for which the second MFE is a first-hop MFE and (ii) forward data packets received from the machines of the set of machines for which the second MFE is the first-hop MFE according to the respective logical networks of the machines from which the packets are received, wherein the set of machines for which the second MFE is the first-hop MFE comprises machines from at least two of the logical networks.