Like you do in Gen 4. I haven't heard of anyone doing this. I assume it's possible.
The only way to perform the DNS glitch in Gen V games is to select the Mystery Gift option via the title screen instead of selecting "Continue Game". The DNS needs to be changed through the 3DS's System Settings, but the actual exploit is performed through the game itself.
Source: DNS Exploit experience