here is a good answer I found searching the forem ...for the same question asked before...
Plumbing codes require an airgap and a P trap. The airgap allowed by most codes consist of running your dishwasher discharge hose looped up and fastened up under the counter top or even higher if possible. A few codes allow a mechanical device and a few are so strict as to go above the countertop/sink top level. Even though it would require a valve failure at the dishwasher, the premise is to keep dirty sink water/oldfood/etc. from siphoning back from the sink and into the dishwasher discharge where cross contamination could(?) occur and contaminate your clean dishes, etc.
Any connection to the drain will also require a p trap to keep sewer gas from coming back your way. Check with your local plumbers and inspector as to what is required but it sounds like you've already been told. I don't know that you would need to drill into the cabinets if you can do this in the dishwasher space but you may not have much room behind for a trap.