Score:0

How to give alternate name to localhost for sharing on windows?

cn flag

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.

pmdba avatar
cn flag
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...
Sara June avatar
cn flag
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
pmdba avatar
cn flag
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.
co flag
@SaraJune: what does the `ping machine1` says?
Score:0
cn flag

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.

Sara June avatar
cn flag
the (echo %userdomain%) is showing only the machine name. Where to get the dns details, not seeing in azure portal also?
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.