This paper proposes distributed algorithms for control and coordination of loads and distributed energy resources (DERs) in distribution networks. These algorithms are relevant for load curtailment control in demand response programs, and also for coordination of DERs for provision of ancillary services. Both the distributed load-curtailment and DER coordination problems can be cast as distributed resource allocation problems with constraints on resource capacity. We focus on linear iterative algorithms in which each resource j maintains a set of values that is updated to be a weighted linear combination of the resource's own previous set of values and the previous sets of values of its neighboring resources. This set of values can be used by each node to determine its own contribution to load curtailment or to resource request.