This likely isn't a DNS or a cache problem. DNS problems would affect all browsers, not just one.
This is almost certainly a proxy problem.
Safari uses the system-defined proxy server preferences whereas Firefox uses its own. Therefore it's possible to have Safari (and most other apps) use one proxy server configuration while Firefox uses another.
Ordinarily that wouldn't be a problem - unless the configuration is invalid... maybe it points to a proxy server that no longer exists, in which case Safari (and most apps) would continue sending requests to the proxy, and never get a response.
The solution is simple - fix your proxy server settings. If you don't need (or think you need) a proxy server, just clear the settings in System Preferences -> Network -> (interface) -> Advanced -> Proxies.
If you should be using a proxy server, check with the network admin as to the correct configuration (e.g. hostname, port, username/password, etc.)
Chances are, for most users, just disabling the proxy settings will work just fine.