When I load Site > CP Home > General Configuration I see the right values in the field: http://www.example.com for an instant. When the page fully loads it will change to http://dev.example.com. The same happens in my local build. It too initially is correct (http://local.example.com) but then switches to http://dev.example.com an instant after the page loads.
Most everything works on these sites. The only issue (other than it being very strange to see) may be Lamplighter. That isn't working and they say the value in that field must match the actual page URL otherwise it will not work.
I read on the EE bug tracker that EE stores some config variables in the database. Does the base_url value get stored in the database? I looked but could not find anything.
I was using Focus Labs multi environment config, but even after reverting back to the stock EE config, index, admin, and database files it is doing it. That leads me to believe the database is storing the information. I have imported and exported the database from Dev to Production and local.