I have a wireless router and not a LAN CONNECTION.so i want to connect my wifi to raspberry pi using USB wifi dongle and unable to do it.I have tried doing it using wifi_config but couldnt open the browser after connection is made.when i open any browser i get an error "couldnt resolve the host"and When i am connecting the wifi in wifi_config i am getting an error "failed AP scan".so,Please find me a solution and suggest me wht to do. I am using a laptop to get connected to my raspberry pi.
So I suppose your router is connected to internet, which means it can provide internet, what needed is you Pi to ask for an IP address using dhcp discovery message, I'm not experienced about wifi_config so I suggest you to turn it back to default.
Then check interfaces manual by
man interfaces, there you'll find many settings for setting the interface settings which are located at
/etc/network/interfaces. After that edit the text file interfaces by
sudo nano /etc/network/interfaces. Add there a stanza including the details of your router(it's SSID and if exists passphrase. And example I can give to you is :
allow-hotplug wlan0 auto wlan0 iface wlan0 inet dhcp wpa-ssid "SSID" wpa-psk "PASSWORD"
If you turn all the other settings to default, this will work for sure. You can get all the meanings of the lines above from
man interfaces and also from another answer that I provided : How to setting up wlan0 that automatically turn on when eth0 is switched off?