I have to do "sudo killall -HUP mDNSResponder" dozens of times daily

Hi

Our development server is structured so that websites are accessed through siteprefix.dev.domain.com:port and I am accessing it this way for years now. Last few weeks whenever I wanted to access this domain.com wither as a direct domain access through browser, or FTP access throufgh Panic Next or any other means of accessing it acts as domain resolution is impossible - firefox says "Hmm. We’re having trouble finding that site. We can’t connect to the server " and all other act similar. When I go to terminal and do sudo killall -HUP mDNSResponder and provide pass it usually works, sometimes I need to do it 2-5 times in a row before it catches up but then this solution fails within minutes and I have to do it again. It is immensely annoying - I have no idea how to even diagnose it so the solution is permament.

I managed a workaround in FTP/Panic software by providing direct IP address instead of domain.com and it works flawlessly

Is there a way I can so the same but system-wide and so that mac knows that this domain.com is a specific IP? I suppose it would require separate IP dor the dev.domain.com as it is a different physical server but generally is there a way to tell mac that domain.com or subdomain.domain.com is a certain static IP address?

Thanks!

iMac Line (2012 and Later)

Posted on Mar 5, 2021 3:50 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 5, 2021 3:58 AM


Is there a way I can so the same but system-wide and so that mac knows that this domain.com is a specific IP? I suppose it would require separate IP dor the dev.domain.com as it is a different physical server but generally is there a way to tell mac that domain.com or subdomain.domain.com is a certain static IP address?
Thanks!


Yes, there is a way to tell your mac that something has a static IP address, and avoid further DNS troubles.


Add appropriate lines to /etc/hosts.

By default it looks like this:


##

# Host Database

#

# localhost is used to configure the loopback interface

# when the system is booting. Do not change this entry.

##

127.0.0.1  localhost

255.255.255.255 broadcasthost

::1       localhost



You can add more lines to it, with the format


IPaddress(tab)domainName


like


192.168.1.253 stuff.where.com



You have to edit the file with admin privileges.


The easiest way, if you are moderately familiar with vi is to do


sudo vi /etc/hosts


in Terminal


4 replies
Question marked as Top-ranking reply

Mar 5, 2021 3:58 AM in response to cgartists


Is there a way I can so the same but system-wide and so that mac knows that this domain.com is a specific IP? I suppose it would require separate IP dor the dev.domain.com as it is a different physical server but generally is there a way to tell mac that domain.com or subdomain.domain.com is a certain static IP address?
Thanks!


Yes, there is a way to tell your mac that something has a static IP address, and avoid further DNS troubles.


Add appropriate lines to /etc/hosts.

By default it looks like this:


##

# Host Database

#

# localhost is used to configure the loopback interface

# when the system is booting. Do not change this entry.

##

127.0.0.1  localhost

255.255.255.255 broadcasthost

::1       localhost



You can add more lines to it, with the format


IPaddress(tab)domainName


like


192.168.1.253 stuff.where.com



You have to edit the file with admin privileges.


The easiest way, if you are moderately familiar with vi is to do


sudo vi /etc/hosts


in Terminal


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

I have to do "sudo killall -HUP mDNSResponder" dozens of times daily

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.