OSX Lion WIFI Ethernet connection loss

 

Sudden problems with connecting to the internet / local network with OSX Lion without changing settings.

Using:
Mac OS X 10.7.5
 
Problem:
Ethernet adapter shows connection, WIFI shows connection but using safari to connect to internet or network fails.
After checking internet modem connection is made and correct ip address is shown, checking in OSX wrong IP address is shown.

 

Solution(s):

solution1

-Go to \System Preferences\Network

-Check the correct settings for your cable network and wifi network

-Turn off Wi-Fi

-Apply and close Network

-Close all running applications

-Start finder and go to:
 Macintosh HD\Library\Preferences\System Configuration

-Drag the System Configuration  folder to the desktop as a backup

-Drag the folder:
 System Configuration from the

 HD\Library\Preferences\ directory to the Trash

-Empty the trash can and restart OSX

-Check the network settings and test if your connection works 

solution2

First i set the network settings manually which gave me network access by IP-address, but still no connection with DNS names could be made to the internet.

Restart OSX with command and R pressed
- Go to utilities and terminal
- Enter 'resetpassword'
- Select 'macintosh HD' and enter password click save
- Click reset and when done restart the Mac

After this i used the following command to reset the DNS cache using terminal

sudo killall -HUP mDNSResponder

and restarted OSX

WIFi connection works
Ethernet connection works

* Deleting of 'Macintosh HD\Library\Preferences\System Configuration' might also be necessary (always backup)

see also:

How to reset the DNS cache
http://support.apple.com/kb/ht5343