Domain = set of allowed inputs
The input x is the independent variable as it can do whatever it wants without relying on y.
-------------------------
Range = set of possible outputs
The output is the dependent variable. It depends on what the input x is. Often, we make y the output dependent variable.
-------------------------
For example, with y = 2x+5, we can plug in anything we want for x (it doesn't need to look to y for guidance or anything). Once we pick something for x, it will directly determine what y is.
Let's say we picked x = 10. That would mean y = 2x+5 = 2*10+5 = 25. The input x = 10 in the domain leads to y = 25 in the range. We see that the output y = 25 depends entirely on the independent input x = 10.