1

I have a jenkins production job which involves multiple nodes/slaves and when we run the job it utilizes them based on the slave mentioned. And also, it has access to some machines shared folders.So from master, it is trying to access shared folders like \machine1\c$\sharefolder1 \machine2\c$\sharefolder2

So for my test environment, I installed jenkins and want to keep everything in a single slave. But,I don't want to modify the jobs.

So, I added entries in my local machine where jenkins is running and added entries to hosts file for machine1 and machine2. \localhost\c$ is opening but not with \machine1\c$ or \machine2\c$ even after adding entries to hosts file.

# localhost name resolution is handled within DNS itself.
    127.0.0.1       localhost      machine1     machine2 

ping is redirecting to 127.0.0.1 loopback address only. But with localhost or 127.0.0.1 it is not prompting for password.But for machine1 or machine2 it is prompting for credentials and typing the machine's credentials is not working.

Sara June
  • 451
  • 1
  • 9
  • 28
  • The comment in your hosts file seems to explain things: "localhost name resolution is handled within DNS". Your hosts file is mostly (entirely?) being ignored... – pmdba Aug 12 '21 at 12:07
  • This is windows 10 2004 gen 1(2 also tried) image. Came default when I try to create a windows 10 machine on azure. Any suggestion on how to make it work? Because hosts file is not ignored I guess, (ping machine1) is pointing to 127.0.0.1 ip to send traffic – Sara June Aug 13 '21 at 12:21
  • I don't know for sure if this is what is happening with your situation, but in my experience some applications favor DNS over the hosts file, or are specifically coded to only use DNS. If your hosts file is working for some things and not others then this is a possibility; you would have to look up the Jenkins documentation to see if there's any mention of how hostnames are resolved. – pmdba Aug 13 '21 at 13:38
  • @SaraJune: what does the `ping machine1` says? – saulius2 Jun 30 '22 at 08:50

1 Answers1

0

Add these hosts, machine1 machine2 and such, to DNS.

Perhaps the test environment has its own zone, test.example.net. Then configure DNS Suffix Search List on test hosts to include that. Resulting in machine1 resolving machine1.test.example.net

Ideally configure a routable IP address for the DNS, not loopback. Gets mildly confusing if anyone forgets that loopback is this host. However nothing technically prevents an AAAA record having the value ::1.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34
  • the (echo %userdomain%) is showing only the machine name. Where to get the dns details, not seeing in azure portal also? – Sara June Aug 13 '21 at 16:40