This could have to do with a corrupted Windows Sockets (WINSOCK) interface. WINSOCK is one of two APIs (Application Programming Interfaces) used by Windows 98 to gain access to resources on a network; the other one being NetBIOS.
WINSOCK components essentially operate "on top of" your network communications protocols (TCP/IP) and physical network hardware. So, when there is WINSOCK corruption it is possible to remain physically connected to the Inernet and even be able to PING public IP addresses. However, you will be unable to access websites by their fully qualified names. For example if you attempt to PING the name www.yahoo.com, you will be unsuccessful but you will be able to PING its corresponding IP address of 126.96.36.199.
Assuming that all of your other TCP/IP settings are correct (especially DNS entries) and that you do not have a firewall blocking port 80, it is possible that the WINSOCK component on your PC is indeed corrupted. If so, it can be repaired using the following procedure:
Use the Add/Remove Programs icon in Control Panel...click the Windows Setup tab...select "Communications" from the list. Uninstall Dial-Up Networking and any other dependant components. Do not yet reboot even if you are prompted to. Next run the registry editor (REGEDIT.EXE)...make a backup copy of your registry...then delete the following keys:
Close the registry editor. Now use Find | Files and Folders from your Start menu and search for the file WINSOCK.DLL. When you find it, rename it to WINSOCK.ASI. Now reboot your PC. Go back to Control Panel | Add/Remove Programs...hit the Windows Setup tab and re-install Dial-Up Networking. Reboot when prompted.
You should now be able to access websites by their fully qualified names as well as by IP address.