I'll cover the no-jailbreak scenario and leave editing or another answer for someone that knows how to change this by modifying iOS.
Without a jailbreak, no. The cellular data is governed by APN settings. You can change these with the iPhone configuration utility and some learning.
The Wi-Fi settings are easy to override using the device itself, but it's not global but instead an override on a per-network name basis. Go to the network settings for a specific Wi-Fi. Under the detailed screen (tap the blue > sign once you are connected) and swipe up to expose the DHCP / BootP / Static IP address part of the screen. You can tap to edit DNS and append, delete or substitute your choice of DNS settings from that screen.
When I need to run a custom DNS, I often use VPN to get to a router with known settings and this works over Wi-Fi and cellular data since all traffic goes to the VPN where I can control the DNS. This requires time and a server (Amazon web service free tier is ideal for low cost hosting).