The Wiki page says
Any undirected graph may be made into a DAG by choosing a total order for its vertices and orienting every edge from the earlier endpo
A total order is basically just arranging all the vertices in some order -- think of it as labelling each vertex with a number from 1 to |V(G)|. This gives us a consistent way to know which vertex is higher for any pair of vertices we examine.
Yes, you can obtain a total ordering with depth-first search. Just assign each vertex the value of an incrementing counter each time you explore a vertex in DFS. This is how you can get a total ordering.
But you don't need to explicitly get a labelling of a total ordering to get a DAG. If we use the above time-of-exploration as our ordering, then we can proceed as follows: Orient edges as you do the DFS traversal, pointing each undirected edge away from the vertex that you're currently expanding.
Basically, we have vertices explored earlier pointing to vertices explored later.
eg. if you had
A
/ \
B---C
and you started by exploring A, you would orient edges incident on A away from A:
A --> B
A --> C
B --- C
Now say you choose B to explore next in your DFS traversal. Then you would leave the edge between A and B alone, because you've already oriented that edge (A has already been fully expanded). The edge between B and C was untouched, so orient that away from our current vertex, B, to get:
A --> B
A --> C
B --> C
When you explore C, all of its neighbours have been fully expanded, so there is nothing left to do for C, and there are no more vertices left to explore.
Response to "More Info":
In that case, just make sure you expand the source vertex first and just don't explore the sink. Eg. for
A-B-C
|/
D
where D is the source and B is the sink, you could: expand D, then A, then C. You would get:
D --> A
D --> B
A --> B
C --> B