I have requirement to access the folder from a another machine based on the IP address. Can anyone suggest me to do with C#.
-Lokesh
Just use the IP as the servername in UNC path like \\10.10.27.35\folder\subfolder\ (Don't forget to escape the \ in C#).
Related
I have a new Linux database server I am working on with a certain hostname and ipaddress. I want to change it's hostname and ipaddress with my old Linux database server's at the time of going live with the new server. I understand this requires only update on the new server's hosts file.
My team says it would need a DNS update. I don't see why it would require a DNS update. Because a DNS is a mapping between hostname and ipaddress and it hasn't changed.
Could anyone clarify?
Thank You, Madhuri Dara
normally, yes indeed, a DNS is a mapping between IP addresses and hostname.
However, I would also recommend to delete the old one an re-create them to perform a re-discovery of the routes.
The best option for you would be here to have a DNS manager into your domain, this way, you could modify them here, instead of into your DNS file in each machine.
The default port for strapi is 1337, and default hostname is "Localhost".
I changed the hostname in the server.json file (that's inside the development folder) to "example.com" and saved that change.
However, when I start the program (by typing npm start in the terminal) although the output indicates that strapi is indeed hosting on "example.org" (and says the administration is at "example.org/admin"), upon navigating to example.org:1337, in a web browser, the page is not accessible. Yet, it is accessible when I navigate to localhost:1337.
I'm new to strapi. Any help will be appreciated. Thanks in advance!
Changing the domain name, inside of a server.json configuration file, won't likely result in your web browser being able to resolve that domain.
When your web browser tries to discover the IP address of a domain name, it first looks in your operating system's host file. If it cannot find the ip address of the domain there, it then tries to look for it at the DNS server that provides name-lookup for your local network.
DNS will typically point your domain to the public IP address of your web server and sometimes, if your web server is located on the same LAN you are, it can be tricky to teach the firewall or local DNS server how to route your browser's request within your LAN.
If you do edit your host file, to make the domain point to an internal IP address, you'll want to remove that entry later in order to access the domain when you are not on your LAN.
I write script that need to be used in different active directory forests.
In one forest I am able to use simple computer names that are the same as the computer samaccountname value.
mycomputername
In another forest I have to use dnshostnames that are normally shaped like
mycomputername.some.domain.path.com
Is this a forest setting and how can I identify this?
If you want to connect to a remote host by name you must be able to resolve the name (be it a hostname or FQDN) to an IP address. Whether you can resolve a hostname or need an FQDN depends on the search domains that are configured (or not configured) on a computer's network adapter.
EDIT: Ugh I forgot to put this on Server Fault...
I have an Azure VM that is hosting a web application.
The application will be accessible via the VM's IP address:
http://191.238.112.62
I want to be able to use query strings to redirect to completely different sites that are within the local IIS. For example:
http://191.238.112.62/?site=1
would redirect to
www.site1.com
The way I have structured IIS can be seen below:
Each site has an entry in the systems host file.
127.0.0.1 wwww.site1.com
127.0.0.1 wwww.site2.com
127.0.0.1 wwww.site3.com
There is likely a better way to achieve what I am going for here so any pointers would be greatly appreciated.
Thanks.
Here is how I would do it. Not sure why you want to use query strings for this as IIS is made to do that if you configure it properly.
In your DNS server register all your websites to point to that IP. This is for when you go live. For development the hosts file is a good solution.
When you create the websites add a Host header like below
Now try loading any website by their full name
http://www.site1.com
http://www.site2.com
http://www.site3.com
Here is more info about IIS host headers.
Again, when you go live make sure you have the DNS set up for all the websites to point to the IP address of your server.
Hope this helps.
Edit based on comment:
Right, here is how I solved this in the past.
You can do all this with the hosts file but it's less painful if you have a proper DNS server to resolve the names.
The basic idea is to use slightly different URLs for development on the local machine.
All devs would have site1.com point to the IP of the shared server and site1.com.local point to 127.0.0.1. So a hosts file on a developer machine would look something like:
191.238.112.62 www.site1.com
127.0.0.1 www.site1.com.local
On all development machines you need to make sure you have the .local host header for all sites.
On the shared server you just need to add the right host headers and no hosts file changes. It's actually a bad idea to change the server hosts file.
This question is in terms of a RESTful ROA (Resource-Oriented Architecture). A resource on the Web has a URL (or URI if you prefer), for instance http://myserver.com/me.jpg.
You can get a file on the local (Windows) machine like this: file:///C:/MyPictures/me.jpg. This is not exactly a "Universal" Resource Identifier; it doesn't work right if you try it on a different machine. On your machine this may be a picture of you instead of me.
Suppose I want to design an application where files can be copied to a web service. Other users on other machines can download them from the web service, but if you are using it from the original machine they are fetched from the local file system for speed.
Is there any concept of a URI that refers to a file on a particular machine if it happens to be the local machine? Is there any concept of a URI for a particular machine? IP address isn't enough; my machine's IP address is 192.168.0.102 and yours may be too.
I would like to store a number of locations for the photo as first choice, second choice etc. First choice = file:///C:/MyPictures/me.jpg but only if the local machine is the machine it came from; second choice = http://myserver.com/me.jpg.
Another way of stating the same question: this machine is unique, and the file at C://somedir/somefile.jpg is unique. Does it have a unique address? An address that would yield either "No Route to Host" or the correct file, depending on where you requested it from?
Is there any concept of a URI that
refers to a file on a particular
machine if it happens to be the local
machine?
Let's follow the logic. How is this to be determined? The URI absolutely must contain a name which uniquely identifies the machine.
Hence, your machine must be identified by a publicly registered name. You have clearly identified that a private IP address is insufficient.
So, the answer is:
Your machine must be publicly accessible (via proxy if behind a firewall) by a publicly identified name.
That name must also resolve directly to your machine (not by a firewall) if you want efficiency in the "local running case".
Setting this up is machine dependent. But assuming you're behind a NAT firewall which supports virtual server proxies...
Register the unique name in the appropriate DNS server, have it resolve to the publicly-facing IP.
Set up a virtual server on your firewall proxying back to your internal address.
Set up a web-server on your local machine.
Ensure that your local machine itself is configured (in /etc/hosts or Windows equivalent) to map that public address to your 192.168 address.
That basically does it. Impossible to imagine how anything else would. No, it's not possible for a single URI to be defined as "Try file:// in this case, or default to http://". The very definition of URI is a single scheme, as described here:
http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax
You're both correct and incorrect. While two computers can have the same name or the same ip address within a network segment, they only exist within that network.
If you want to uniquely identify a file and a machine, then file://blackbeauty.mydomain.org/c:\myfile.txt is perfectly acceptable, in the sense that the blackbeauty name is "owned" by mydomain.org.
So you will need a way to address machines in FQDN if you want the URL to be resolvable.