Requery /etc/hosts without reboot
Hi all.
Does anyone know of a way to force any connection (browsers and ping) to requery the hosts file. My problem is best described with an example.
1. Go to www.apple.com
2. Add "192.168.1.2 www.apple.com" to /etc/hosts
3. Restart the browser
4. Go to www.apple.com (the change to the hosts file hasn't been applied)
5. Reboot the machine
6. Go to www.apple.com (the change has now been applied)
For various reasons i amend my hosts file fairly regularly and would like a way of seeing these changes being propagated without having to Reboot the machine.
I hope that explains my problem.
Regards
Duncan
Thanks for you quick reply, I tried that by going to system preferences / network and changed Configure IPv4 from Using DHCP to off, then back to Using DHCP.
I restarted the browser and ... no change I'm afraid.
So unless there is a better / different way to disable / enable the network I'm afraid that doesn't help.
I moved from Ubuntu to my Mac this morning. All I used to have to do was restart Firefox, which was annoying enough, now it looks like I have to reboot on top of that...
Similar Messages
-
Change mailhost in /etc/host without reboot
I have to change the mailhost entry to point to another host on a few machines. Ho can i bring sendmail to recognize this change, just simply svcadm restart sendmail ist not enough. I had a few systems in the past which I rebooted, so it worked, but a reboot is not an option for these systems.
FritzMartin_Rosenau wrote:
Hello.
What settings did you change?
MartinHi martin
I have changed the below mentioned settings
o set semsys:seminfo_semmni=100
o set semsys:seminfo_semmns=1024
o set semsys:seminfo_semmsl=256
o set semsys:seminfo_semvmx=32767
o set shmsys:shminfo_shmmax=4294967295
o set shmsys:shminfo_shmmni=100
Thanks
Rajan -
How to save changes in /etc/system without system reboot
Hi
As I have one query in case I am updating /etc/system, is there any way to make the changes effective without rebooting the system.
Thanks
RajanMartin_Rosenau wrote:
Hello.
What settings did you change?
MartinHi martin
I have changed the below mentioned settings
o set semsys:seminfo_semmni=100
o set semsys:seminfo_semmns=1024
o set semsys:seminfo_semmsl=256
o set semsys:seminfo_semvmx=32767
o set shmsys:shminfo_shmmax=4294967295
o set shmsys:shminfo_shmmni=100
Thanks
Rajan -
/etc/hosts and /etc/inet/hosts
we're running Sol10x86 11-06 and notice that there's no link between /etc/hosts and /etc/inet/hosts as there has been on some previous versions. /etc/hosts is the only file that contains all of the info for our IPMP configuration, and that seems to be enough during reboot.
what looks at /etc/inet/hosts? any danger in making /etc/inet/hosts a link to /etc/hosts?I don't have a copy of 11/06, but I've never seen a default installation of Solaris without that link.
It's certainly there in 08/07. Is there any chance that whatever process is populating /etc/hosts on your machines is breaking that link?
Darren -
How to restart VSS writers without rebooting
Hello fellow teckies.
I'm having this problem when backing up with Symantec Backup Exec 11d where it generates errors about not being able to backup VSS sections on the C drive.
I've already posted with Symantec.
https://www-secure.symantec.com/connect/forums/vss-c-drive-errors-when-backing-server
They're saying to re-register and restart the services. My question is, can the services be restarted without rebooting?
Unfortunately rebooting is not an option as this is a critical production server.
If anyone can answer, please let me know.
Thanks :)What Santhosh mentioned is on the right direction. To restart a VSS writer, you need to restart the services or process that hosts the writer. Generally speaking, we will
take the following steps when encountering VSS writer related issues:
Retry the backup or restore operation that caused the error condition.
If this does not resolve the issue, restart the service or process that hosts the writer, and retry the operation.
If this does not resolve the issue, open Event Viewer as described in the "Open Event Viewer and view events related to VSS" section and look for events related to the
service or process that hosts the writer. If necessary, restart the service or process, and retry the operation.
If this does not resolve the issue, restart the computer, and retry the operation.
If restarting the computer does not resolve the issue, provide the Event Viewer information to the vendor whose application is indicated in the event text.
http://technet.microsoft.com/en-us/library/ee264212(WS.10).aspx
As for the impact of the restart, it generally will not cause bad effect. However, it depends on the service which is restarted. Generally speaking, a service should handle
all the related task, such as writing all data in memory into disk and committing the transaction, etc, when a properly restart operation is performed. If there are any particular requirement or order to follow to restart a service or application, you should
follow the recommended restart procedure.
Meanwhile, it is reported that when performing Shadow Copy Components backups with the File Server Resource Manager (FSRM) installed you may encounter this issue. Please
refer to the following Symantec article:
http://www.symantec.com/business/support/index?page=content&id=TECH48419
NOTE: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control
these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the
use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
Laura Zhang - MSFT -
VPN clinetside IP overlap - tweak /etc/hosts possible?
Hi,
Our internal IP range is 192.168.0.x
We have remote users who VPN in from client offices, hotels, airports, etc. If the clientside local network address is also in the 192.168.0.x range, VPN does not work correctly due to the overlapping address ranges. This happens often enough to be a serious problem for our road warriors.
Does anyone know whether /etc/hosts can be tweaked to be different for different Network Locations? Are there any other means to this end? If so we can create a VPN VLAN (say, 192.168.100.x) with our servers multihomed onto that VLAN smooth VPN access.
Thanks,
b.
PS. Apologies for cross-posting in client & server.Buckster: this can't be done without some serious hacks, and even so, would probably still involve manual changes when switching to a new location, and probably reboots as well.
Painful as it is, it will almost definitely be far easier to renumber your central office LAN (where the VPN server is). When I set up a LAN that I know might be VPN'd into in the future, I try to use an obscure range (i.e. 192.168.169.x, 10.30.50.x, 172.16.17.x, etc.) - that's unlikely to be used by the SOHO routers/firewalls commonly deployed in remote locations.
MacBook Pro Mac OS X (10.4.8) -
Network-profiles (1) and /etc/hosts
Hi everyone,
i've got a few network-profiles, especially in one network I have to use a static ip to connect to the internet. The only entry in the /etc/hosts which works correctly - without any error messages - for me, is
192.168.0.99 localhost.localdomain myhost
If I use something like 127.0.0.1 in front and simply add my hostname at the end, I can't connect with the Inet, unfortunately. I did not test it, but I'm pretty sure, that this host configuration won't work in any other network, where I get a dynamic IP from the DHCP. Is there a possibility to write the content of the /etc/hosts with netcfg, like the /etc/resolv.conf for example?
MfG SkitBecause you didn't specify what localhost was in your hosts file. It only knows of localhost.localdomain(does not imply 'localhost') and acer being the loopback.
I think he understood that.
'localhost' is universally understood as the loopback.
this is some kind of 'magic' answer isn't it? the resolving doesn't come out as a miracle... and that is IMHO what needs explanation.
his computer alone doesn't (obviously) get it because sure, it's not set. now what 'magic' makes it known when a cable is plugged in? the computer tries to reslove locally (via /etc/hosts), fails at it, and then asks the dns server about it. so I reckon the dns server is instructed on replying '127.0.0.1' for a 'localhost' hostname request. why so? because dns servers have an option to look at their local /etc/host for resolving before delegating to bigger servers, so the dns server certainly has localhost matching 127.0.0.1 in his /etc/host, and blindly replies accordingly, oblivious to the fact that he is replying about his 'own' 127.0.0.1 to someone else.
Last edited by lloeki (2008-01-16 08:24:12) -
Is there a similar file to windows\ssytem32\drivers\etc\hosts in OS X
Hi,
I am running a Windows 2003 Server with several websites. I would like to view my websites from my new Imac, however I keep getting prompted for the user name and password for the router.
In windows on my old computer I could edit the file C:\Windows\System32\Drivers\etc\hosts with the IP address and URL of the site and it would open. Is there a similar file in the Mac OS X 10.5.7 software.
Many Thanks in anticipation{quote:title=Herr Lazaro wrote: > So if /etc/hosts works reliably I'll probably switch to it}{quote}
Adding host records by editing the /etc/hosts file is not entirely reliably. Since Leopard, some people have reported issues of the added host records "mysteriously" disappearing, or Apache not being able to properly resolve the added hosts. The bigger issue is that the modifications in the /etc/hosts file can create unwanted side effects in the normal functioning of services like the mail server and others.
Since Leopard, there has been an alternate way to add host records using the dscl utility. In fact, by many, it is considered the better, more reliable, and safer method.
You can read this recent article to see how its done:
http://tomafro.net/2009/07/dscl-the-easy-way-to-add-hosts-on-osx
There are a number of additional articles on the web about using dscl for adding host records to OS X.
The choice, of course, is yours. If you are using the /etc/hosts file without issue, then it might be safe to continue doing so. But, if your system starts experiencing domain name resolution issues or problems with services such as the mail server, you should consider switching to and using the dslocal database to manage your host records. -
/etc/hosts, /etc/hostname.bgeN configuration
I am writing this to get help.
I have a Solaris 10 box.
bash-3.00$ uname -a
SunOS soft19 5.10 Generic_125100-10 sun4u sparc SUNW,Netra-240
I have the following stuff on this box,
bash-3.00$ cat /etc/hosts
# Internet host table
127.0.0.1 localhost
10.9.48.244 soft19-bge1 Secondary
10.9.16.121 soft19 loghost
#10.9.48.244 soft19 Secondary
bash-3.00$ cat /etc/hostname.bge0
soft19
bash-3.00$ cat /etc/hostname.bge1
soft19-bge1
bash-3.00$ ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
inet 10.9.16.121 netmask ffffff00 broadcast X.X.X.255
bge1: flags=1000843 mtu 1500 index 3
inet 10.9.48.244 netmask ffffff00 broadcast X.X.X.255
In our code base, we have the following,
struct hostent *hp;
hp = ACE_OS::gethostbyname(myhostname); // myhostname is soft19
hp->h_addr_list[0] will give 10.9.16.121
Everything is correct here!!
Now I change the configuration a bit,
bash-3.00$ cat /etc/hosts
# Internet host table
127.0.0.1 localhost
#10.9.48.244 soft19-bge1 Secondary
10.9.16.121 soft19 loghost
10.9.48.244 soft19 Secondary
and now
hp->h_addr_list[0] will give 10.9.16.121
hp->h_addr_list[1] will give 10.9.48.244
but when I reboot the system, I get the following,
bash-3.00$ ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
inet 10.9.16.121 netmask ffffff00 broadcast X.X.X.255
bge1: flags=1000843 mtu 1500 index 3
inet 0.0.0.0 netmask ffffff00 broadcast X.X.X.255
And I know this is because
bash-3.00$ cat /etc/hostname.bge1
soft19-bge1
Now I change /etc/hostname.bge1 to have just soft19
and I reboot the system and what I see is this
bash-3.00$ ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
inet 10.9.16.121 netmask ffffff00 broadcast X.X.X.255
bge1: flags=1000843 mtu 1500 index 3
inet 10.9.16.121 netmask ffffff00 broadcast X.X.X.255
Which is correct again!
Now my question is
With this
struct hostent *hp;
hp = ACE_OS::gethostbyname(myhostname); // myhostname is soft19
I want to have the following,
hp->h_addr_list[0] will give 10.9.16.121
hp->h_addr_list[1] will give 10.9.48.244
How can I get this even if the system reboots?Hi, Thanks, but I know this. And was expecting the same.
But my question still remains unanswered..
How to tweak /etc/hosts and /etc/hostname.bgeN files for....
With this code
struct hostent *hp;
hp = ACE_OS::gethostbyname(myhostname); // myhostname is soft19
I want to have the following,
hp->h_addr_list[0] will give 10.9.16.121
hp->h_addr_list[1] will give 10.9.48.244
One more thing, I want to get this all the time, even my system reboots.
I know a method to get below [by modifying /etc/hosts file]
hp->h_addr_list[0] will give 10.9.16.121
hp->h_addr_list[1] will give 10.9.48.244
but this will not work when the system reboots? I am looking for a permanent solution.
Thanks,
Atul -
Sshd ignores /etc/hosts.allow and /etc/hosts.deny
Hello everyone,
I've just found out that sshd ignores /etc/hosts.allow and /etc/hosts.deny completely on my machine. It doesn't make use of tcp_wrappers. I am using the standard Arch package. Either my settings are wrong, or this is a severe security problem. It was a terrible surprise to find out that my server is under severe dictionary attacks all the time, despite the denyhosts script I am using.
These are my settings:
/etc/hosts.deny:
ALL: ALL
/etc/hosts.allow:
# some nfs daemons: 192.168.1.0/255.255.255.0
sshd sshd1 sshd2: ALL EXCEPT /etc/hosts.evil
mysqld: 192.168.1.0/255.255.255.0
/etc/hosts.evil:
195.113.21.131
60.10.6.53
A simple experiment to verify the settings:
[root@charon etc]# tcpdmatch -d -i /etc/xinetd.conf sshd 195.113.21.131
warning: sshd: no such process name in /etc/xinetd.conf
client: address 195.113.21.131
server: process sshd
matched: hosts.deny line 5
access: denied
[root@charon etc]# tcpdmatch -d -i /etc/xinetd.conf sshd 195.113.21.130
warning: sshd: no such process name in /etc/xinetd.conf
client: address 195.113.21.130
server: process sshd
matched: hosts.allow line 10
access: granted
This seems to be fine. But when I go to the machine 195.113.21.131, I can simply log in with no trouble at all.
This is really strange. Does it have something to do with the xinetd warning? I am not using xinetd... Maybe I'm doing something wrong. If you have experienced such a trouble, please give me a hint.elasticdog wrote:So should our package not have the ListenAddress 0.0.0.0 line uncommented by default? My guess would be that since it listens on all local addresses by default, we're just overwriting that when specifying 0.0.0.0, which isn't valid. That was users don't have to specify their local IP address. Unless I'm wrong, shouldn't this be a bug/feature request for the packager?
This doesn't seem to be a package bug... IMHO, sshd must respect all the settings in hosts.deny and hosts.allow, regardless the IP address it listens on. The behaviour I noticed seems to be much more complicated. Basic settings (daemon name mentioned in hosts.*) worked, as far as I didn't want a "per IP" configuration. For example, including the daemon in hosts.allow really enabled remote connections, but any closer specifications (subdomains, EXCEPT operator...) were ignored. Access was simply granted without further evaluation. Excluding sshd from hosts.allow worked as one would assume. When I specified ListenAddress, everything started to work properly. This is mysterious. There are millions of computers using tcp wrappers and ssh, so it's hard to believe there could be a bug. -
/etc/hosts entries ignored
My Mac Pro, OSX 10.5.8, is ignoring entries in the /etc/hosts/ file. I have been all over the net and not found the definitive solution to this for 10.5.8
I know that 10.5.8 does not use /etc/resolv.conf in the expected way, so adding at the top of resolv.conf the line 'order hosts/bind' does not work.
This is a super handy trick for the work I do (I do lots of conversions and migrations of websites and databases) and I have come to depend on my Mac resolving from the hosts file first, before going on to normal DNS.
Any pointers would be very helpful.
-BoscoThat is probably because the *NetInfo Manager* application is no longer used. I use host file entries for ad blocking (in Snow Leopard, too), and it works just fine.
The OP may have improper entries or is doing something like using a text file with non-Unix line endings, but without further feedback it is hard to say. -
[SOLVED] Strange line in /etc/hosts
I was checking my /etc/hosts when I came across this line:
64.50.236.214 releases.mozilla.org
Should that line be there? Is it safe?
That ip points to a mirror site.
Last edited by Skoll (2010-01-14 19:54:14)toxygen wrote:you didn't add it? you can always comment it out with a hash # and see if it gives you problems (restart network afterwards (sudo /etc/rc.d/network restart)). doesnt look like it would do any harm though, other than limiting you to that one mirror
No, I didn't. That's why I was so worried.
Edit: I can download plugins with Firefox even without that line. I found out that my brother had used an arch live cd to change /etc/hosts because he couldn't download plugins, the problem mcmillan mentioned.
Thank you guys for quick answers.
Last edited by Skoll (2010-01-14 19:53:39) -
'Flush' launchd without rebooting server?
I created a daily 6am disk usage report, then moved it to 8am... but then it began running at 6am and 8am... so I unloaded the job and found the 8am job kept running, even though there's no mention of it in the 'launchd list' results!
I've used the following one-liner to print out the contents of all the loaded launchd jobs, but none of them have been overwritten by my plist, or in any other way call the script that my launchd job was created to run... very weird.
for i in `launchctl list | awk '{ print $NF }'`; do launchctl list $i ; done
I've unloaded, reloaded, and anything else I can think of at the commandline or in Lingon (launchd interface), but can't stop this job!
Is there any way to restart launchd, or flush its cache/database of jobs, without rebooting the server??Thanks for the thought BDAqua, but cron keeps its jobs in /etc/crontab while launchd uses XML plists and each job is a seperate file.
I haven't touched cron, and cant see a way that launchctl or Lingon (both solely launchd utils) would have injected the job into cron, but I checked anyway and found it wasn't the case. cron has been deprecated in favour of launchd.
launchd is the root of all processes, so i understand if there's no mechanism for restarting it (because it would kill everything else running) but I'm hoping there's a way to get it to rescan all the plist locations like it does on boot, so it will hopefully drop the spurious job and reingest the updated plist. -
Tcp wrappers /etc/hosts.allow format
since most of the services that were originally run from
the /etc/inet/inetd.conf file on pre-Solaris 10 systems
are now run from smf, what are the "in.*" service names
that should be placed in the /etc/hosts.allow file?
also is there a "safe_finger" available for use that can
be used in the /etc/hosts.deny file or should the
"standard" Solaris 10 finger be used?
Thankselasticdog wrote:So should our package not have the ListenAddress 0.0.0.0 line uncommented by default? My guess would be that since it listens on all local addresses by default, we're just overwriting that when specifying 0.0.0.0, which isn't valid. That was users don't have to specify their local IP address. Unless I'm wrong, shouldn't this be a bug/feature request for the packager?
This doesn't seem to be a package bug... IMHO, sshd must respect all the settings in hosts.deny and hosts.allow, regardless the IP address it listens on. The behaviour I noticed seems to be much more complicated. Basic settings (daemon name mentioned in hosts.*) worked, as far as I didn't want a "per IP" configuration. For example, including the daemon in hosts.allow really enabled remote connections, but any closer specifications (subdomains, EXCEPT operator...) were ignored. Access was simply granted without further evaluation. Excluding sshd from hosts.allow worked as one would assume. When I specified ListenAddress, everything started to work properly. This is mysterious. There are millions of computers using tcp wrappers and ssh, so it's hard to believe there could be a bug. -
Dynamic online disk array without (reboot -- -r) on Solaris 10.
I am seeking a way to online a new disk array after I have added the array into the fabric (FC switch) with Solaris OS 10 without reboot and reprobe HW command.
This used to work for Solaris OS 9 or lower using command "devfsadm" or "devfsadm -c disk" (class specific).
Leadville command "cfgadm -al" did not see the new path as I was hoping for with tag of "unconfigure" (so that I can configure it in).
Any suggestion on how can I online the disk array using certain OS (Solaris 10) command would be very much appriciated.
Please, let me know.
If it is possible. My email address is
[email protected]
thanks much
juan.Folks,
Interesting info as I tried with SPARC base runing Solaris 10 OS. The daemon is auto imported the unit without I have to issue the OS scan device "devfsadm".
# cat /etc/release
Solaris 10 3/05 s10_74L2a SPARC
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 22 January 2005
This issue is seen on X386 platform, only.
# cat /etc/release
Solaris 10 3/05 s10_74L2a X86
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 22 January 2005
thanks
Hoang.
Maybe you are looking for
-
This is the error message I get when I try and open Firefox: ''The application or DLL C:\Program Files\Mozilla Firefox\WSOCK32.dll is not a valid Windows image. Please check this against your installation diskette.''
-
Hi, I'm relatively new to creating JTree components, now I have looked at many examples, and this one is nearest (i can see) to how I want my Jtree to look, however it doesn't behave in a way which I would like! Firstly, I can set the root node to ha
-
Regarding the budget release and assignemnt of budget.
Hi, I have created investment profile and distibuted the budget.(IM01,IM11,IM22 & IM52) Partial release of budget is done through (IMCBR3) Project is created and investment position ID is assigned (CJ01) WBS element is created under the above project
-
I have an issue with apple remote desktop, and a network account. i have install the app in my desktop network account, once the application finish installing. Asks me for a password, i change the password input the serial number import the list. Onc
-
Error message "clc.exe has stopped working".
When I start Photoshop I get an error message "clc.exe has stopped working". I have the latest version drivers for my Acer X23H and HP 2311 LCD monitors so upgrading them is not possible. Is there any other fix I can try?