‫For this tutorial, I'm going to go through the assignment of DNS Round Robin testing and you'll get
‫to see how I would have done it.
‫First, we need to create a network.
‫I'm going to call it dude.
‫Then I need to create two containers. So,
‫I'm going to run them in the background. I don't actually care about their names.
‫So, I'm just going to run the network and attach them to dude.
‫And then I'm going to do a net
‫alias so I can find them with the DNS name search.
‫And then...
‫there we go.
‫Because I'm not specifying a name,
‫I can actually just hit the Up arrow and type the exact same command again,
‫and I should get both of those containers.
‫I didn't open any ports because all we need to do is test inside of this virtual network.
‫You'll notice that there's exposed ports, which we'll talk about later in the next section. But exposed
‫ports are listed in the Docker file, and they're always exposed in the virtual network. It's only
‫necessary to use the -p when we want to actually publish those ports to the outside interface of
‫our host.
‫We're not doing that here so I can skip that part.
‫Now I need to run a test to make sure I can get to both of these with the same DNS names. So docker
‫container run, and I'm going to do this the easy way by doing a --rm on alpine nslookup search.
‫Oops...net dude.
‫This should run the nslookup command on the search DNS entry and then immediately exit. Then it'll
‫clean itself up with a --rm.
‫All right. There we go.
‫I have two DNS entries. For the next one, docker container run rm net
‫dude centos curl with a -s
‫on search
‫9200.
‫All right.
‫That will get me back the Elasticsearch server named Interloper.
‫If I run it again, I get the other one.
‫Mr. M.
‫You'll notice that there's also a unique ID for each one of these, and that if I hit the Up Arrow
‫and run this command over and over, it's not exactly going to be even steven here.
‫It's going to be a little random.
‫You see two in a row and that sort of thing.
‫That's just indicative of DNS Round Robin due to things like name caching and whatnot.
‫If I do docker container...oops
‫ls. I can actually remove these...I'm going to force them.
‫And there we go.