Tämän päivän kysymys- ja vastausistunto tulee meihin SuperUserin hyväksi - Stack Exchangein alaosasto, joka on yhteisöllinen Q & A-sivustojen ryhmittely.
Kysymys
SuperUser-lukija JqueryLearner haluaa tietää, miten verkkosivuston IP-osoite on:
If I want to know the IP address of a website, then one way is to ping the website. For example, if I want to know the IP address of google.com, then I can ping it via the command prompt.
Can anyone tell me how to get the correct IP address?
Jotka mitä JqueryLearner tarvitsee selvittääkseen oikeat IP-osoitteet verkkosivustoille?
Vastaus
SuperUser-avustajat Paul ja lesca ovat meille vastaus. Ensin ylös, Paul:
Your starting assumption is that all websites can be accessed via their IP address directly. This is not the case.
In many cases (I’d venture most cases), the website that is presented at an IP address is dependent on the website name you are requesting. For example, if you request superuser.com, you will first resolve this to an IP address, then make a request to the IP address for a specific webpage. It looks like this:
This is why a single web server can host multiple websites using a single IP address. In the case of the Stack Exchange sites, any or all of them can be on each of their servers, and you’ll get the one you ask for. If you just put in an IP address, you won’t get any of them, because you are not telling the web server which of the many websites you are after. In these cases, it may have a “default” website defined, or just return an error.
If you are trying to work around an issue with your DNS provider, then one option you have is to modify your hosts file so that you are resolving addresses yourself, rather than have an external party do it for you.
So for example, if you edit:
Seuraaja vastineen lesca:
To get the IP address of a website, the best way is to use the nslookup command. For example:
One more lookup proves I am right:
Onko jokin asia lisättävä selitykseen? Kuulkaa kommentit. Haluatko lukea lisää vastauksia muilta tech-tajuilta Stack Exchange-käyttäjiltä? Katso koko keskusteluketju täältä.