123Macmini.com
FAQFAQ   SearchSearch   MemberlistMemberlist   GalleryPhoto Gallery   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Updating Hosts File

 
Post new topic   Reply to topic    123Macmini.com - Forums Forum Index -> Mac Networking
View previous topic :: View next topic  
Author Message
bluewhite4
New Member
New Member


Joined: 21 Feb 2008
Posts: 5

PostPosted: Wed Aug 27, 2008 11:01 pm    Post subject: Updating Hosts File Reply with quote

I have a couple SMB shares that are on my network, that I have created a script to auto-connect to. The problem seems to be that the mini doesn't recognize their dns name right away. I want to add them to the hosts file, since they won't ever change ip addresses anyway. I've found a tutorial on how to do that, but then it says that I need to use "sudo niload -v -m hosts . < /etc/hosts" to reload the database. However, it looks like in 10.5 that niload has been replaced. Does anyone have an updated command to fully refresh the dns cache for the hosts file? (That is without restarting the mini)
Back to top
View user's profile Send private message
Chris..S
Veteran Member
Veteran Member


Joined: 25 Feb 2007
Posts: 704

PostPosted: Thu Aug 28, 2008 5:27 am    Post subject: Reply with quote

You don't need to. Editing /etc/hosts will be sufficient. Some software, like your web browser, will cache dns responses for a short time (a few minutes) but not too long.
Back to top
View user's profile Send private message
bluewhite4
New Member
New Member


Joined: 21 Feb 2008
Posts: 5

PostPosted: Thu Aug 28, 2008 6:51 am    Post subject: It doesn't seem to.... Reply with quote

After I edit the hosts file, if I try to ping that name, it doesn't ping the correct address from that terminal session or another though.
Back to top
View user's profile Send private message
Chris..S
Veteran Member
Veteran Member


Joined: 25 Feb 2007
Posts: 704

PostPosted: Thu Aug 28, 2008 8:54 am    Post subject: Reply with quote

Using ping in iTerm, works fine and instantly for me.

Quote:

Test methodology

ping www.somedomain.com
get real ip.

add 127.0.0.1 www.somedomain.com to /etc/hosts
ping www.somedomain.com

get 127.0.0.1

edit /etc/hosts, change domain to 192.168.0.5
ping www.somedomain.com

get 192.168.0.5
Back to top
View user's profile Send private message
miniconvert
Senior Member
Senior Member


Joined: 30 Sep 2007
Posts: 383

PostPosted: Fri Sep 05, 2008 3:39 pm    Post subject: Reply with quote

What does your hosts file look like?
_________________
Intel Mac Mini, 1.83 C2D 2.5GB, 80GB, Combo Drive
Graphite G3 iMac DV SE, 400Mhz, 512MB, 30GB
iPod Touch (1st Gen)
Back to top
View user's profile Send private message
Chris..S
Veteran Member
Veteran Member


Joined: 25 Feb 2007
Posts: 704

PostPosted: Fri Sep 05, 2008 4:21 pm    Post subject: Reply with quote

/etc/hosts
Code:

##
# 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
fe80::1%lo0     localhost

127.0.0.1    computername
127.0.0.1    computername.mydomain.tld

192.168.0.3      othercomputername

# spam/ad/popup protection
127.0.0.1       ctr.andale.com
# ... lots more of these
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    123Macmini.com - Forums Forum Index -> Mac Networking All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



      

Shop:  Apple Store  |  Refurbished Macs  |  Refurbished iPads  |  MacConnection  |  Mac Mini Vault  |  Other World Computing

MK 1 Studio Mac mini Racks  |  Crucial Mac Memory  |  Top Free Mac Apps  |  Top Paid Mac Apps



123Macmini.com is an independent publication and has not been authorized, sponsored, or approved by Apple Computer, Inc.
All logos and trademarks in this site are property of their respective owners.
Copyright © 2011 123Macmini.com. All Rights Reserved.