Avatar of Zolf
Flag for United Arab Emirates asked on

Access application using name instead of IP address

Hello there,

I have 2 web application on 2 different Tomcat machines with static IP and my clients connect to these application by entering the ip address of the servers to access the application. Please the the attached image to get a better idea. Now my problem is the clients need to enter the IP of the machine to access the web application, how can the client access the app using some domain name like, www.app1.com or www.app2.com on a local network. I will appreciate any help.

Web DevelopmentNetworking* Tomcat* NginxWeb Servers

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon
ios man

Nice blog with genuine information. Thanks alot.

bydia nox uktvnow
David Favor

What you seem to be asking for, is someone to setup vanilla DNS for your two sites.

Simple searches will turn up many guides about how to do this + the summary is to setup two A records for the domains you mention above.

Likely you'll do this with your domain registrar, like GoDaddy or Namecheap.

Since this appears to be internal traffic, all that needs to be done is to create 2 A records on your internal DNS server.

If external access was involved, then registering a domain might become necessary. Whether you have an domain name to use already or end up registering one, A records would be necessary.

So no matter what, you need A records. Where you put them depends on whether the users are internal or external.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck

Thanks for your comments.

My setup is a private network, it will be accessed locally. I also dont have a DNS server in my network. Please give me suggestion on these.
Sajid Shaik M

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Hosts file would be your only solution. Since it's only two computers and a two entries for each, not a big deal. But if the network grows, recommend changing the strategy.
David Favor

As masnrock said, use your /etc/hosts file for local network setup.

Problem is keeping /etc/hosts in sync across many machines, if required.

Far better to setup host records in real DNS for app1 + app2, so app1.foo.com + app2.foo.com so any client can connect + always get back the correct IP, even if that IP is a local 127.0.0.X IP which will make your management of IP resolution far simpler.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.