Mac cached routing? (traceroute) - macos

So I got a problem regarding access to my website. Whenever I run traceroute on my computer it returns the correct traceroute to the correct site. However when I run it on someone elses pc it gives a completely different traceroute but wrong traceroute (an old one).
Some info that might help:
- My PC: Windows
- His PC: Mac
We both loaded the sites a few times before and he is still on the old traceroute from a couple of months back.
I already tried clearing the DNS server of Mac OS X, Rebooting it, Clearing browser cache (even a full reset of the browsers) and still it is not loading in any of the browsers.

if IP address of remote website is different, try to manually set DNS server to check if it solves the problem
static DNS can be changed with nslookup (windows, maybe on mac also)
you can set manual DNS by the 'server' command in nslookup prompt :
C:\Users\me>nslookup
Default Server: nfdns.bezeqint.net
Address: 192.117.235.235
> www.stackoverflow.com
# this is my dns
Server: nfdns.bezeqint.net
Address: 192.117.235.235
Non-authoritative answer:
Name: stackoverflow.com
Addresses: 104.16.37.249
# changing dns server
> server 1.2.3.4
Default Server: [1.2.3.4]
Address: 1.2.3.4
# now can check again with the new dns
> www.stackoverflow.com

Just found it, I overlooked the /etc/hosts file, so there was still an error in it. Thanks for helping!

Related

windows: ping url fails but ping -4 url works in local network

I have been learning some network and system administration and encountered a puzzling problem.
SETUP:
I setup a small local offline network with a Windows Server 2019 and a Ubuntu server hosting gitea. In the Windows Server I have assigned a static IP of 169.254.0.2 and installed DNS and DHCP roles. In the Ubuntu server I have assigned a static IP of 169.254.0.3.
DNS has been configured with a primary zone funlab.abc. I created a single A record for gitea.funlab.abc. to point to 169.254.0.3. DHCP has been configured to lease addresses from 169.254.0.100 to 169.254.255.254. Subnet mask is 255.255.0.0.
PROBLEM:
With this setup, I successfully got client machines to connect to the local LAN network, transparently get a dynamic IP address, and access gitea.funlab.abc through the browser.
But in windows 10 client machines, I am unable to run ping gitea.funlab.abc in command prompt. I get an error message :
Ping request could not find host gitea.funlab.abc. Please check the name and try again
Git clone/push operations involving the URL gitea.funlab.abc also does not work.
However I can run ping -4 gitea.funlab.abc successfully. Git clone/push operations can also work if I replace the URL with the static IP. nslookup gitea.funlab.abc works correctly as well.
QUESTION:
Why is this happening? What did I misconfigure such that ping and git commands do not work?
Turns out ping and git commands works just fine when I change the IP address to 192.168.X.X. I guess windows treat the 169.254.X.X addresses differently.

Web App on LAN VM: curl -L works from other vms, browser/curl on host doesn't

I am in the process of setting up a Hadoop cluster of virtual machines on my LAN and a process on one of the vms (the ResourceManager) provides a Web UI which is exhibiting strange behavior. All vms run from my desktop and have been assigned ips.
The URL I am targeting is resourcemanager:8088 and here is the behavior.
From other vms running on my desktop:
curl -v resourcemanager:8088
returns an HTTP 302 Found response with Location: http://resourcemanager:8088/cluster. Looking this up I saw this is a redirect, and curl -L resourcemanager:8088 successfully retrieves the HTML.
From the desktop running the vms:
Trying to reach the URL from (Chrome) browser gives net::ERR_CONNECTION_REFUSED. Also
curl resourcemanager:8088
returns curl: (7) Failed to connect to resourcemanager port 8088: Connection refused.
Each vm has the same /etc/hosts:
::1 localhost
127.0.0.1 localhost
10.0.0.3 namenode
10.0.0.4 resourcemanager
10.0.0.5 datanode1
and the .../drivers/etc/hosts file on my (Windows) desktop looks the same minus the localhost lines.
To make matters more complicated, a second process (the NameNode) also provides a web ui, call it namenode:50070, and I am able to curl it from both the desktop and vms, and I can get to it via browser from my desktop.
Any ideas?
EDIT
Specs:
Desktop OS: Windows 10
VMs OS: Arch Linux latest (Linux kernel 4.5.4)
An initial Arch+hadoop VM was created with Hyper-V, then cloned to create the three "cluster" vms listed above. After cloning, each vm was given a unique hostname (listed above) and assigned a reserved IP address from my router (also listed above). All VMs use an "external vm switch".
I cannot comment, because I do not have 50 reputation yet, but that might have to do with the configuration of the service behind port 8088: The VM probably got a 'small' netmask from the virtual dhcp server, which presumably covered the IP range of all other VMs, not including the host machine. If that had happened and the service was configured like many others -to listen on all interfaces- it would not react on requests and your connection would reach a closed port, causing a 'connection refused' error. How is that?

Hosts file ignored Mac 10.11.4 El Capitan

I am running a RoR app on my local. I have some translations in my hosts file.
127.0.0.1 localhost
127.0.0.1 example.dev
127.0.0.1 www.example.dev
127.0.0.1 api.example.dev
They were working fine, until I updated my OS to 10.11.4. If I send ping request to www.example.dev, it seems to work fine. The IP it translates to is 127.0.0.1.
But when I visit www.example.dev in my web browser, it seems to ignore hosts file and ping DNS server for IP.
I am not sure how, but going to localhost in browser does translate to 127.0.0.1.
Dont know why but ive disabled my lookback adapter and ipv6 and now its working.
so in your host file disable these two items
# ::1 localhost
# fe80::1%lo0 localhost
Some fubar osx bug... I miss steve....
I came across this while searching for an answer to a similar problem and wanted to post my findings for anyone else in the same position.
As a team of three, we found that edits to my /etc/hosts file appeared to work, while editing the other two's host files seemingly did not. Upon further digging, we realized I was on OS X 10.10, while they were on newer versions.
We found, after trying about a million things, that additions to the hosts file in 10.11 and up apparently could not have more than one space between the IP and the domain, for example:
DID NOT WORK:
1.2.3.4 some.site.com
DID WORK:
1.2.3.4 some.site.com
After making this change, we immediately started seeing expected results without any cache clears, reboots, or otherwise.
The host you are overriding is resolving via IPV6. ::1 is the loopback address for IPV6 which is analogous to 127.0.0.1 in IPV4. Add the following entries as the last lines in your /etc/hosts file.
::1 localhost::1 www.example.dev

Xcode Server is unavailable

I am trying to setup CI on an Xcode Server. I have a Mac running OSX Server with Xcode Services up and running (seems to be working). The Mac is hosted in the cloud.
When I try to add the server to Xcode on my local Mac dev machine, it says "Xcode Server is unavailable". What "server address" do I use. I tried the IP address as well as the machinename.companyname.com address.
Note I have enabled the "file sharing" service and this works fine using machinename.companyname.com.
I configured my router to forward the relevant traffic to the server. This process is called port forwarding.
Opening these ports worked for me
Protocol Port Range ---- Comment
TCP 22 ---- ssh
TCP 80 ---- http
TCP 443 ---- https
TCP+UDP 3690 ---- svn
TCP+UDP 9418 ---- git
TCP+UDP 20300 ---- xcode1
TCP+UDP 20343-20345 ---- xcode2
reference: https://support.apple.com/en-ae/HT202944
I am having the same problem you are. My server is not in the cloud, but it is setup to be accessible outside of my network. I am able to add my server because it is seen by Bonjour. Everything works fine that way. However, I can't add the server by using the IP or the www address.
I've verified that TCP ports 22, 80, and 443 are forwarding correctly. I also have TCP/UDP 3690 and 9418 forwarded correctly.
One thing I wanted to add is that I can add repositories that exist on the server without issue. It is just adding the server that is causing a problem.
I have filed a bug report with Apple and will comment back here as soon as I get a response.
I think I solved my own problem. After upgrading to Xcode6, need to upgrade to Yosemite too. Don't know why but this seemed to fix the issue.

Using dnsmasq on a Windows VM in VirtualBox on a Mac (+ MAMP)

I'm using dnsmasq on the Mac (OS X 10.7) to facilitate local development (along with MAMP), with just this pretty simple config:
[dnsmasq.conf]
address=/dev/127.0.0.1
.. pretty darn simple. All my *.dev domains resolve to 127.0.0.1 (localhost). Together with:
[DNS Servers]
127.0.0.1
8.8.8.8
8.8.8.4
..as my Mac's DNS settings, this works a treat.
But then I also have a pretty stock Windows 7 SP 1 VM running in VirtualBox (latest). It uses 10.0.2.* as its IP subnet within Windows. At the moment I have to use a service like http://xip.io + another hostname alias to use my *.dev sites in Windows, e.g:
[ if Mac's local IP is 192.168.1.50 ]
something.dev.192.168.1.50.xip.io
..and I need to have this extra ServerAlias manually set up in my Apache config, and keep it updated each time my local IP address changes.
Is there any way I can set up either dnsmasq, VirtualBox, or my Windows IP settings (or a combination of these) so that I can use my .dev hostnames (e.g. http://something.dev/) directly from Windows?
Try this:
https://github.com/stackia/DNSAgent
It has functions similar to Dnsmasq server= and address=
and a rule converter: https://stackia.github.io/masq2agent/
If you mean that you want to run something like dnsmasq on your windows vm then I share your pain. I have been trying to get something setup on a windows host to do wildcard localhost sites without doing something like xip.io but I am having problems getting it to work. Dnsmasq on the osx machine I have was a breeze, but trying to get Acrylic DNS to work on windows the same way hasn't worked. I do have it running as a local caching DNS, and it should be doing the wildcard part, but having problems getting over the final steps.
Check it out. Looks neat, free, and a dnsmasq alternative on windows. And if you get it working post your results! I'll do the same if I can get it going.

Resources