Recursive least-squares (RLS) schemes are of paramount importance for online estimation and tracking of signals, especially when the state and/or data model are unknown. Here, a distributed RLS-like algorithm is developed that can operate in ad hoc wireless sensor networks (WSNs). The novel algorithm is obtained by writing the weighted squared-error cost associated with an RLS algorithm in a separable form and applying the alternating-direction method of multipliers to minimize it in a distributed fashion. This distributed adaptive scheme can be applied in general WSNs that are challenged by communication noise and do not necessarily possess a Hamiltonian cycle. Relative to competing alternatives, the novel algorithm offers more efficient communications. Numerical examples indicate that the proposed scheme is resilient to communication noise, while it performs efficient tracking of time-varying processes.