How the domain name and IP get mapped? - ip

Suppose xx.xx.xx.xx is the ip address of www.yyyy.com then the server can be accessed by http://xx.xx.xx.xx:port/.
How and where www.yyyy.com get mapped to http://xx.xx.xx.xx:port/ ?

The Mapping is done by DNS(Domain Name Server). You can read more here .
Edit:
Check this for more info.

Related

Can FQDN be replaced by IP address in TDengine?

We built a test environment with TDengine, with a 4 nodes cluster. We configured the FQDN(Fully Qualified Domain Name) according the document. It's OK.
Now we have a requirement to use IP, not FQDN. However, I didn't find the instructions through the web.
How do I fix it?
I think you can simply replace host name with IP, it works in my test env.
You should set the fqdn option in taos.cfg file as ip, for example:
fqdn 192.168.1.10
And set the firstEp in client or another dnode with:
firstEp 192.168.1.10:6030

Can I Use an IP Address in a SRV Record?

I'm trying to understand whether or not is it possible to use an IP address in a SRV record's "Target" section instead of an hostname.
I noticed that when querying an SRV record (using dig or dnsjava) on a DNS server I'm getting the resulted hostname following a trailing dot (absolute path) - this means that if I want to use an IP address I'll have to chop the dot, so I'll be able to connect to targeted IP.
Is this follows the SRV's specification (RFC 2782) ? And if I'm obligate to use a hostname, can you please explain why ?
I'm asking this for being able to implement the client side which fetch the result for a certain service after querying the relevant SRV record.
The RFC you reference defines "Target" as:
The domain name of the target host. There MUST be one or more
address records for this name, the name MUST NOT be an alias (in
the sense of RFC 1034 or RFC 2181).
Therefore the target cannot be an IP address.

How to block 127.0.0.1:8080

I am trying to block http://127.0.0.1:8080/ in C:\Windows\System32\drivers\etc host file. so what i did is:
127.0.0.5 http://127.0.0.1:8080/AccessCtrl/login.jsp
But is not working, i can still access this site.
As I know ,hosts file is for DNS caching .
I mean one side must be an IP address and the other side must be Domain name server. So you can't do such a thing.
The hosts file only maps domain names (e.g. www.example.com) to ip addresses.
Therefore your approach won't work for two reasons:
What you're trying to block is not a domain name, but a URL
The URL you're trying to block doesn't contain a domain name, but an IP address.
You should be able to "block" the domain "localhost" this way, but you'd still be able to access http://127.0.0.1:8080/, just not http://localhost:8080/.
What you need here is a firewall, like the windows firewall.

IP address from nslookup sometimes doesn't work, e.g. with wikipedia

As I understand it, nslookup [domain_name] will give you the IP address of a domain name. When I run nslookup wikipedia.org, I get
Server: 138.23.146.213
Address: 138.23.146.213#53
Non-authoritative answer:
Name: wikipedia.org
Address: 198.35.26.96
So if I enter 198.35.26.96 in my web browser, I should reach wikipedia.org. This works for some websites, like google.com and facebook.com, and mozilla.org. But it gets an error for other websites, like wikipedia.org, craiglist.org, and wordpress.org.
Does anybody know why?
An IP address identifies a server, not a website. There might be more than one websites hosted on the same server.
When you enter a domain name (eg. wikipedia.org) in your browser's address bar, your browser first resolves the domain name to get an IP address (that is 198.35.26.96). Then it constructs an HTTP request having a parameter named Host with a value wikipedia.org and sends it to the address 198.35.26.96.
The server receives the response, reads the Host parameter and knows which website the user is looking for. So the browser essentially needs both IP address of the server and domain name of the website to open it.
In some web servers a "default website" might be defined, that is if the Host parameter is absent or its value is an IP address then the server will serve the default website to the user. This was the case with google.com and facebook.com. If a default website has not been set (eg. in wikipedia.org), the server will simply reply with an error saying the domain was not found.

subdomain with rewriteModule

i'm using this rule for rewriting subdomain
and i'm corrected host file to
127.0.0.1 domain.net
when user typed news.domain.net/default.aspx it must return domain.net/news/default.aspx but browser showed Address not found.
how do i?
please help
thanks all
When you add the entry to your HOSTS file, it will only correct the exact DNS lookup - in your example, "Domain.net" would resolve to 127.0.0.1, but "news.domain.net" won't resolve to anything, since there's no server at that address. If you add an entry to your HOSTS file for:
127.0.0.1 news.domain.com
That will resolve that domain to your local machine, and then you can configure IIS to rewrite that URL to whatever you want.

Resources