This species has been recorded foraging for insects flushed by grazing cattle and buffalo, in a manner similar cattle egrets, and has been observed fishing off the backs of hippopotamuses. It has also been recorded feeding in association with banded mongooses; when a band of mongooses began hunting frogs in dried mud at the side of a pool of water a pair of hamerkops attended the feeding group, catching frogs that escaped the mongooses. The strangest aspect of hamerkop behaviour is the huge nest, sometimes more than across, and strong enough to support a man's weight. When possible, it is built in the fork of a tree, often over water, but if necessary, it is built on a bank, a cliff, a human-built wall or dam, or on the ground. A pair starts by making a platform of sticks held together with mud, then builds walls and a domed roof. A mud-plastered entrance wide in the bottom leads through a tunnel up to long to a nesting chamber big enough for the parents and young. Nests have been recorded to take between 10 and 14 weeks to build, and one researcher estimated that they would require around 8000 sticks or bunches of grass to complete. Nesting material may still be added by the pair after the nest has been completed and eggs have been laid. Much of the nesting material added after completion is not sticks, but an odd collection of random items including bones, hide, and human waste. Pairs of hamerkop are compulsive nest builders, constructing three to five nests per year whether they are breeding or not. Both members of the pair build the nest, and the building of nests may have a function in creating or maintaining the pair bond between them. Barn owls and eagle owls may force them out and take over the nests, but when the owls leave, the pair may reuse the nest. Owls may also use abandoned nests, as may snakes, small mammals such as genets, and various birds, and weaver birds, starlings, and pigeons may attach their nests to the outside. A few reports exist of hamerkops nesting close together, including in Uganda, where 639 nests were seen in an area of ; even if each pair had made seven nests, this would mean 80 pairs were nesting in that area. The species is not treated as colonial, as it does not habitually nest close together, but is not thought to be highly territorial, either. Even where pairs have home ranges that are more spread out those home ranges overlap and are the boundaries are poorly defined.