Score:0

map url to local server

cn flag

I have several webapps in different aws servers. They communicate via webservices. https://myserver1.com https://myserver2.com https://myserver3.com

I hnow if I put all that apps in the same server they continue working with no problems. From app1 I call the webservice in app2 (myserver2) and it responds correctly. If I call app2 from app1 in the same server, is there a waste of time checking dns addresses on dns servers ? or the communication is made inside the server ? The server1 knows that server2 is also in the same machine ? Is it better to map the 'external' urls to a folder inside the server to avoid traffic out and traffic in ?

Tks

Score:0
cn flag
raj

It's not quite clear what you're exactly asking about.

I understand you are moving from the setup where you have applications on two different servers, ie. https://myserver1.com and https://myserver2.com, to the setup where both applications are on the same server?

But how the applications are calling each other? Do they still use the addresses https://myserver1.com and https://myserver2.com (only the domains myserver1.com and myserver2.com now point to the same machine)? Or are they using a common http://myserver.com ? Or are they using https://localhost when calling each other?

Except the last case, the DNS lookups must still be performed. After the DNS lookups the server will know that the IP addresses for domains are assigned to the same machine, so the actual communication between applications will occur inside the machine. But first the DNS server must be consulted anyway.

localhost is a special case because that name is by default listed in the /etc/hosts file together with the IP address 127.0.0.1. Names that are in the /etc/hosts file are immediately translated to corresponding IP addresses, without the need to perform DNS lookup.

So if you want to avoid the DNS lookup for myserver1.com and myserver2.com (or single myserver.com if this is the case) you can put these names into /etc/hosts file with the corresponding IP addresses.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.