The only knots a dock line should have are those that you tie around cleats. The art of tying nautical knots, known as Marlinspike Seamanship, is an skill all boaters should learn.
Dock lines can be expensive, so wherever your dock line goes such as a chock or other hardware, use chafing gear around it. Chafing gear or guards can be purchased at a marine store, or you can make your own, out of an old piece of garden hose or get in good with your local fire dept. and see if you can get some old fire hose.
The diagram above is a example of how to secure your boat to a pier.
Good dock lines and good fenders are your first line of defense against hull damage. Use nylon line that's correctly sized for your boat's length and weight, and learn how to tie a proper cleat hitch.