-1

In our organization, we've a in house maven repository say http://mymavenrepo.com to store private artifacts and that is being used across projects.

But recently ip address of machine, where mymavenrepo was hosted, has changed and hence we had to make a change in hosts file with new ip to build maven projects successfully.

My question is why we need to make change in hosts file with changed ip and what can be done to avoid change in hosts file every time ip is changed, like for http://www.google.com, we never have to make entry in hosts file.

Alpha
  • 13,320
  • 27
  • 96
  • 163

1 Answers1

0

Well I would say this is somewhat of a loaded question. The Hosts file on your machine may overwrite a DNS query because it is the first file that a computer reads to find a domain. The Hosts file essentially acts as the DNS in the sense that it translates IPs to Domains.

Now, I am assuming that the local repository is a private repository or in other words NOT published on the internet. Which I might be wrong, but that would mean that it might have a private IP address accessible only to the local network which would make it reasonable to stay in the hosts file. If it DID have a public address, or accessible to the outside internet, then removing its entry from the hosts file would allow for the DNS to query it.

My suggested solution here based on my local-local assumption is to SET a static IP to the repository and exclude it from the DHCP server so it doesn't change. The way to do that depends on the solution you have and the underlying OS.

Dharman
  • 30,962
  • 25
  • 85
  • 135
wragaey
  • 1
  • 1