The distal tubule is actually two things, the regular, straight distal tuble and the more kinked distal convoluted tubule. It is a part of the nephron in the kidneys of mammals. It is the last part of the tubule before the cortical collecting duct, and the latter is shared between neprhons, not a part of any individual nephron. This portion of the nephron is very very important to its precise function as a filter.

The juxtaglomerular apparatus communicates (chemically) between the distal tubule (DT) and the afferent arteriole of the same neprhon.

Changes in flow rate in the DT due to changes in glomerular filtration rate play havoc with the flow-regulated fluid composition in the nephron. The macula densa will sense this and help to regulate fluid flow via tubuloglomerular feedback.

Angiotension II causes increased sodium uptake in the DT, as part of the renin angiotensin aldosterone system. It does so by increasing sodium channel production in the DT and increasing the activity of sodium-potassium ATPase. This increase also causes more water reabsorption in the same area, because where sodium goes, water follows. A low plasma osmolality will cause inhibition of antidiuretic hormone, thus making the DT largely impermeable to water, and causing water diuresis.

The distal tubule is also responsible for tweaking potassium excretion. If plasma potassium levels fall (hypokalemia), the tubules will stop secreting potassium and reabsorb more. If, however, plasma potassium levels rise (hyperkalemia), the DT will stop reabsorbing and start secreting it.

These are my interpretation of my lecture notes, but I may have used some references from Hole's Anatomy and Physiology (Shier, Butler, Lewis) and Human Physiology (Vander, Sherman, Luciano)