This is a mixture of ux and implementation. The ux part is the consideration on behalf of the user to be able to clearly see where this came from (plus other links printed out).
Optimizing web pages for print is important because we want our sites to be as accessible as possible, no matter the medium. We shouldn’t make assumptions about our users and their behavior. People still print web pages. Just think about articles or blog posts, recipes, contact information, and directions or real estate sites. Someone somewhere will eventually try to print one of the pages you made.
I won't put any css markup here (better handled by stack overflow), but here's a fairly recent article regarding print stylesheets:
I totally forgot about print style sheets
It has a section regarding print links out.