Today, I just tried adding a host entry, with a custom port number.
Well to my surprise it did not translate it.
If you can ping an ip from the command line, then it can definitely be added as a host entry.
I mean, it can be an existing IP or a non-existent one, but not an invalid IP.
So, I tried to ping the ip with the port number. Gives an error. I tried to ping the IP without the port number.
I could ping it. So it was obvious, that the port number was the probem.
DNS does not understand port numbers. Host entries include DNS entry. Hence, the hosts file would not be able to translate it.
Hosts file translates host names to IP addresses and vice versa. It cannot understand port numbers.
There could be many ways of handling it, as hosts file does not understand port numbers. This depends on the context of the issue.
Well to my surprise it did not translate it.
If you can ping an ip from the command line, then it can definitely be added as a host entry.
I mean, it can be an existing IP or a non-existent one, but not an invalid IP.
So, I tried to ping the ip with the port number. Gives an error. I tried to ping the IP without the port number.
I could ping it. So it was obvious, that the port number was the probem.
DNS does not understand port numbers. Host entries include DNS entry. Hence, the hosts file would not be able to translate it.
Hosts file translates host names to IP addresses and vice versa. It cannot understand port numbers.
There could be many ways of handling it, as hosts file does not understand port numbers. This depends on the context of the issue.
- You can use a router for port forwarding to a new site, then add the router address as a host entry. I'm not sure this is the best way or not.
- While deploying your database, you could set up an alias, if the port number change is because of migrating your website and setting up DB on a new server. Setting Up Alias for MS SQL Server. It allows you to specify optional parameters in the Protocol Box, like port number, pipename, connection string.
- I'm not sure about above cases would work in all scenarios. They are very specific. We would normally have such cases for our test or development environments. Whats the matter, if you simply add an entry like the one below.
xxx.xxx.xxx.xxx YourSite
When you access it, you type the url
YourSite/portNumber.
"Great blog created by you. I read your blog, its best and useful information. You have done a great work. Super blogging and keep it up.php jobs in hyderabad.
ReplyDelete"
Excellent…Amazing…. I’m satisfied to find so many helpful information here within the put up,for latest php jobs in hyderabad. we want work out extra strategies in this regard, thanks for sharing.
ReplyDelete• Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating. Power Bi Online COURSE
ReplyDelete