Где находится hosts в mac os. Как редактировать ​​файл Hosts на Mac и зачем это нужно делать? Рис. П9.1. Переход к папке

Справедливые, не завышенные и не заниженные. На сайте Сервиса должны быть цены. Обязательно! без "звездочек", понятно и подробно, где это технически возможно - максимально точные, итоговые.

При наличии запчастей до 85% процентов сложных ремонтов можно завершить за 1-2 дня. На модульный ремонт нужно намного меньше времени. На сайте указана примерная продолжительность любого ремонта.

Гарантия и ответственность

Гарантию должны давать на любой ремонт. На сайте и в документах все описано. Гарантия это уверенность в своих силах и уважение к вам. Гарантия в 3-6 месяцев - это хорошо и достаточно. Она нужна для проверки качества и скрытых дефектов, которые нельзя обнаружить сразу. Видите честные и реальные сроки (не 3 года), вы можете быть уверены, что вам помогут.

Половина успеха в ремонте Apple - это качество и надежность запчастей, поэтому хороший сервис работает с поставщиками на прямую, всегда есть несколько надежных каналов и свой склад с проверенными запчастями актуальных моделей, чтобы вам не пришлось тратить лишнее время.

Бесплатная диагностика

Это очень важно и уже стало правилом хорошего тона для сервисного центра. Диагностика - самая сложная и важная часть ремонта, но вы не должны платить за нее ни копейки, даже если вы не ремонтируете устройство по ее итогам.

Ремонт в сервисе и доставка

Хороший сервис ценит ваше время, поэтому предлагает бесплатную доставку. И по этой же причине ремонт выполняется только в мастерской сервисного центра: правильно и по технологии можно сделать только на подготовленном месте.

Удобный график

Если Сервис работает для вас, а не для себя, то он открыт всегда! абсолютно. График должен быть удобным, чтобы успеть до и после работы. Хороший сервис работает и в выходные, и в праздники. Мы ждем вас и работаем над вашими устройствами каждый день: 9:00 - 21:00

Репутация профессионалов складывается из нескольких пунктов

Возраст и опыт компании

Надежный и опытный сервис знают давно.
Если компания на рынке уже много лет, и она успела зарекомендовать себя как эксперта, к ней обращаются, о ней пишут, ее рекомендуют. Мы знаем о чем говорим, так как 98% поступающих устройств в СЦ восстанавливется.
Нам доверяют и передают сложные случаи другие сервисные центры.

Сколько мастеров по направлениям

Если вас всегда ждет несколько инженеров по каждому виду техники, можете быть уверены:
1. очереди не будет (или она будет минимальной) - вашим устройством займутся сразу.
2. вы отдаете в ремонт Macbook эксперту именно в области ремонтов Mac. Он знает все секреты этих устройств

Техническая грамотность

Если вы задаете вопрос, специалист должен на него ответить максимально точно.
Чтобы вы представляли, что именно вам нужно.
Проблему постараются решить. В большинстве случаев по описанию можно понять, что случилось и как устранить неисправность.

Need to edit or modify the hosts file on a Mac? This guide will show you exactly how to edit the hosts file in Mac OS. You’ll find hosts in Mac OS X is stored at /private/etc/hosts but it can also be accessed at the more traditional location of /etc/hosts. That said, if you’re looking to edit hosts, you’ll want to target the file located in /private/etc/ though.

We’ll walk through how to manually edit the hosts file in MacOS Mojave, MacOS Catalina, MacOS High Sierra, MacOS Sierra, OS X El Capitan, Yosemite, OS X Lion, OS X Mountain Lion, and OS X Mavericks, this will be done with the command line using the simple text editor called nano. Don’t let the command line or Terminal sound intimidating though because it’s not, we’ll make the entire process of editing a Mac hosts file super easy.

How to Edit Hosts File on Mac OS

Let’s get started making some edits to /etc/hosts in macOS and Mac OS X!

  1. Launch Terminal, found in /Applications/Utilities/ or launched through Spotlight
  2. Type the following command at the prompt:
  3. sudo nano /private/etc/hosts

  4. Enter the administrator password when requested, you will not see it typed on screen as usual with the command line
  5. Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications
  6. When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano
  7. Quit out of Terminal when finished

You can verify your hosts modifications immediately with ping, Safari, or any other network app.

Changes take effect immediately though some adjustments may need to be accompanied by a which can be done with the following command in macOS 10.12+ through OS X 10.9:

dscacheutil -flushcache;sudo killall -HUP mDNSResponder

When flushing DNS cache with that command you will need to enter the admin password.

If you’d like to see how this entire process is accomplished before doing it yourself, watch the video below to see a demonstration of the hosts file being modified on OS X to block the website ‘yahoo.com’ from loading:

Note: the procedure is the same with older versions of Mac OS X, though the path to hosts could be /etc/hosts if the version of OS X is dated significantly.

Tips to Consider When Editing Hosts Files

The following tips go beyond OS X and apply to any hosts file, be it on a Mac, Windows, or Linux.

  • The preceding IP address is where the following domain will resolve to
  • Always add new hosts to their own unique line
  • The # symbol functions as a comment, it can be used to add comments to hosts entries or to comment out hosts modifications
  • You by adding them to the file and sending them nowhere, preventing access
  • You can redirect websites locally using the same logic, perfect for
  • With some modifications, it can be necessary to with dscacheutil before the changes take effect
  • For juggling multiple hosts files consider using a
  • If the hosts file claims to be locked, it’s because you did not prefix the edit with the “sudo” command
  • Consider making a backup of hosts if you plan on making significant modifications, or it’s your first time editing the file (process described below)

Making a backup of the hosts file can be a good idea if you plan on making significant changes or just want to play around with modifications and see what happens, a simple way to do that would be to use this command, which would store a backup in your home ~/Documents/ folder:

sudo cp /private/etc/hosts ~/Documents/hosts-backup

Then, if you wanted to restore the modified hosts to the backup of the original file, you just have to swap the paths like so and rename the file again:

sudo cp ~/Documents/hosts-backup /private/etc/hosts

That’s it, though again you may need to flush the DNS for changes to take effect.

Finally, it’s worth mentioning that if you’d prefer to avoid the Terminal and the command line completely, you could to modify the contents of hosts that way through System Preferences instead. Generally speaking though, we recommend just using the tools that are built directly into the Mac.

Let us know in the comments if you have any questions or tips.

First of all, what is the hosts file, and how does it differ from the more commonly known DNS?

The Domain Name System is the database that corresponds an IP address’ “dotted quad” numerical format with a website’s alphabetized web address. It’s a giant directory of which name belongs to which IP address, like an online yellow pages.

Your Mac’s hosts file, however, is localized to your own device, like a list of contacts in your phone: The web address acts as your contact’s name - that’s how you find who you want to talk to - and the IP address is their cell phone number, which is your actual way of getting in touch with them.

How editing the hosts file works

Editing your Mac hosts file is a bit like changing the phone number in your contact book. If you save the contact details with the wrong name, well, it’s still going to connect to that person when you ring the contact. If, however, you entered an incorrect phone number in our contacts analogy, whether that’s an invalid number or one that links to someone else’s, then you have no chance of getting through to that particular cell phone.

Editing the hosts file reroutes the IP address, but only from your own Mac. Entering the web address will bounce you to a different IP address of your choosing (and therefore a different website) or to an invalid IP, which will give you an error page on your browser that says it can’t find the site you’re looking for.

Can it boost my Mac"s speed?

Editing a hosts file is a way to speed up your browser performance. But if you"re tired of half-measures and want some solid improvement, we recommend a full browser cleanup, including deletion of browser cache. Our personal favorite is as it has a tool to uninstall browser extensions and the rest of the garbage Macs accumulate from the web, emails and message chats. Check it out - .

So why would you want to change your hosts file?

Typically if you enter a web address in your browser, it’s because you want to reach that IP address. So what are the benefits of rerouting?

    Network Testing: If you’re developing a network, you can reroute the real domain name to the development site to see how real users experience it. This will not affect other users accessing the real site.

    Block Malicious Sites: Apart from the risk of viruses and malware, undetected add-ons can also find their way into your system and begin slowing things down. Although it’s always worth investing in pop-up ad blockers, editing the hosts file prevents known malicious sites from being accessed. If a link or pop-up attempts to enter the site, your OS simply re-routes it and takes you to a safer page.

    Increased Speed: As we said earlier, finding a website via the DNS is like flicking through the yellow pages for the correct address. With the hosts file being localized to your Mac, this could potentially speed up your browsing by omitting the middle man.

    Improved Productivity: Maybe you or your team are getting distracted with social media sites or video streaming. Blocking access to time-wasting sites is a good way of keeping focused on the job at hand.

How to edit the hosts file with Terminal

Note: You will need administrator privileges, including the password, to edit the Mac hosts file.

1) Find the Terminal application on your system. You can do this by either:

Use the Spotlight application to search for it.

Select Applications from the sidebar of a Finder window, and from there select Utilities and then double-click on Terminal.

2) Once you have the Terminal window open, you can access the Nano text editor, which is where you will edit the hosts file. Type sudo nano /etc/hosts and hit Enter. You’ll then be prompted for your administrator password. Once you’ve entered it, hit Enter again and you will be in the Nano text editor.


The Nano text editor might look intimidating if you’re not used to coding on your OS, but don’t worry: it’s very simple, and very easy to do.

3) Use your keyboard arrow keys to position your cursor beneath the text that is already there. This is where you’re going to enter your alternative IP address. Type the IP address that you want the site to reroute to, hit tab, and then type the domain name you want to be associated with it. So, if you would prefer that YouTube reroutes to your homepage, simply type the numerical IP address of your site, hit Tab, and then type www.youtube.com. To add another entry, simply enter a new line of text.

If you have no particular alternative site in mind, or you simply want to block access to it entirely, you can either enter an invalid IP address, such as 000.0.0.100, or use 127.0.01, which always refers back to your own system.

4) Save the changes by pressing control and O, and then exit the Nano text editor by pressing control and X, which will return you to the main Terminal screen.

5) To make sure your Mac doesn’t get confused by the conflicting information from its hosts file and the DNS, before you exit the command line type sudo killall -HUP mDNSResponder and hit Return. This clears your Mac’s DNS caches so that the old directory doesn’t conflict with your newly updated hosts file.

How to edit the hosts file with TextEdit

An alternative to the Terminal application is to use TextEdit instead.

1) Click Finder > Go > Go to Folder...

Then type /private/etc/hosts and press Go. This will locate the hosts file in the ‘etc’ folder.


2) Copy the file onto your desktop, and then double-click the copied file to edit it. In the open text file, add your line of alternative IP addresses just as you would in Terminal: First the rerouted IP address and then the corresponding domain name. Make sure that there is a space between the IP address and the domain name, otherwise it won"t work.

If you don"t want your Mac to access certain websites, use 127.0.0.1 for IP address. This will reroute the address back to your Mac. For example, if I wanted to block the access to Facebook on a particular Mac, I would edit hosts file to look like this:


Note: If the file is locked to prevent you from editing it, which is likely if you’re running on OS X 10.11 or later, you must disable SIP protection before you can make any changes.

3) Save the file, and then drag it back into the ‘etc’ folder. Your Mac will ask if you want to replace the file, which you do, and you will have to enter your administrator password to save the changes.

Remember, even if you own the domain name you are rerouting, the web address itself will not be affected. The hosts file only changes what happens on the Mac that contains it.

The risks of editing hosts file

Remember, you’re rerouting a domain to an IP address, not specifically a website. So if you have set one domain to be sent to another site, this depends on the IP address staying the same. If the destination website changes its IP address, your new route will no longer be valid, with the domain either ending up in a new website or producing an error message.

If your server is still taking too long to process requests, it may not be the DNS lookup that is slowing you down. It might be worth running a full clean of your OS to make sure the lag isn’t coming from your Mac.

How else you can protect privacy on your macOS

Anyone reading this is concerned enough about privacy and security to want to find a solution. As we’ve outlined in this article, there are several ways this can be done manually. Some of these fixes take time. Other solutions are fairly quick and easy to implement.

With , you can clean your system cache, user cache (which includes app and DNS cache history) and your browser cache. Of course, there is the manual way, as outlined in this article, or you can save a lot of time with one download and a few clicks to remove any digital footprints you want to delete.

If you want to clear cache safely and easily, here is how you can with CleanMyMac X:

  1. Launch CleanMyMac X ()
  2. Select System Junk.
  3. Click Scan > Clean.

In case you need to remove just DNS cache, do the following:

  1. Go to the Maintenance module.
  2. Choose Flush DNS Cache.
  3. Click Run.

Done! Your DNS cache flushed.

That’s all you need to do. Give it a try, or go through the steps outlined above to do this manually.

Большинству из нас по тем или иным причинам приходилось сталкиваться с довольно важным в любой операционной системе файлом под названием "hosts" и его редактированием. Служит этот файл для сопоставления определенных доменных имен их сетевым адресам и, в отличие от DNS, контролируется администратором каждого конкретного компьютера, т.е. локально.

И если пользователи Windows, которые уже сталкивались с этим файлом и его редактированием знакомы с этим понятием и, скоре всего, помнят путь до нужного файла наизусть (но мы, на всякий случай, напомним -Windows\system32\drivers\etc\hosts), то новые пользователи компьютеров от Apple под управлением Mac OS X (macOS) поначалу часто теряются, не обнаружив искомый файл hosts по привычному для них пути, как, впрочем, и самого пути в их Маке.

Именно о том, где находится файл hosts на Mac и как его открыть и отредактировать мы и расскажем в этой подробной инструкции ниже.

К счастью, найти и отредактировать файл hosts на Mac ничуть не сложнее, чем сделать это в операционной системе от Microsoft. Нам известно как минимум два способа, о которых и пойдет речь ниже. Вы можете воспользоваться тем из них, которых вам покажется быстрее и удобнее.

Как открыть файл hosts через терминал Mac OS

Тем пользователям техники Apple, кто не боится слова "терминал", этот способ покажется наиболее быстрым и удобным. Для просмотра и редактирования файла hosts на Mac и введите в ней следующую команду.

sudo nano /private/etc/hosts

Также вам потребуется ввести пароль администратора, если он задан на компьютере.

Если вы всё ввели правильно, перед вами откроется содержимое файла hosts вашего Мака.

Внесите необходимые изменения в этот файл (курсор мыши в терминале не работает, для перемещения между строками используйте стрелочки клавиатуры), к примеру, добавьте сайт, который вы хотите заблокировать.

После внесения всех необходимых изменений нажмите сочетание клавиш "ctrl+X" для сохранения.

Нажмите клавишу "Y" для подтверждения сохранения изменений. Вот и всё, файл hosts успешно отредактирован.

Для того, чтобы сделанные изменения сразу же вступили в силу, иногда необходимо вашего Mac.

Как открыть файл hosts в текстовом редакторе

Для тех пользователей Mac"ов, которые ещё не очень хорошо "дружат" с Терминалом, есть альтернативный вариант открыть и изменить файл hosts при помощи любимого текстового редактора и стандартного файлового менеджера Finder.

Для этого кликните правой кнопкой мыши (или используйте аналогичное действие трекпада) по иконке Finder на нижней панели (Dock) вашего компьютера и выберите в выпадающем меню пункт "Переход к папке..." .

В открывшемся окне введите путь, по которому находится файл hosts в компьютерах с операционной системой OS X и нажмите кнопку "Перейти". Выглядит путь следующим образом.

В результате откроется окно Finder"а в папке, в которой искомый файл и расположен. Он будет уже выделен. Просто кликните по нему правой кнопкой и откройте его с помощью вашего любимого текстового редактора (подойдет и стандартный TextEdit).

Сам файл защищен от редактирования. Однако при попытке внести изменения вам будет предложен создать его копию - так и сделайте. Внесите необходимые изменения в копию файла и сохраните его, к примеру, на рабочем столе как файл с названием hosts. Разрешение.txt у сохраненного файла после этого удалите.

В последнем пункте этой инструкции вам нужно просто заменить старый файл hosts на свежесозданный простым перетаскиванием его с рабочего стола в папку, где находится оригинальный файл. Во всплывающем окне подтвердите действие нажатием кнопки "Заменить" .

Это всё. В результате описанных действий ваш компьютер будет использовать уже новый файл hosts. Но иногда, для того, чтобы изменения вступили в силу сразу же, вам может понадобиться обновить кэш DNS. Об этом ниже.

Обновите кэш DNS

В большинстве случаев сделанные вами в файле hosts изменения будут применены незамедлительно, однако если этого почему-то вдруг не произошло - не расстраивайтесь, попробуйте сбросить кэш DNS. Для этого в терминале выполните следующую команду (потребуется ввод пароля администратора).

dscacheutil -flushcache; sudo killall -HUP mDNSResponder

После этого указанные в новом файле hosts правила точно будут работать так, как надо.

В операционных системах macOS и Windows есть файл hosts, который работает как локальный распределитель адресов и их доменных имен (на манер DNS). Он настраивается администратором компьютера самостоятельно, и параметры, внесенные в него, касаются только конкретного устройства.

Рассказываю, где отыскать файл hosts, как его отредактировать и зачем это может понадобиться.

Редактирование файла hosts в текстовом редакторе

Обычно, чтобы внести изменения в файл hosts, администраторы открывают его через «Терминал», но не все пользователи достаточно хорошо владеют командной строкой. Если вам привычнее работать в графическом интерфейсе, то отредактировать файл hosts можно следующим образом:

По умолчанию этот файл защищен, и редактировать его нельзя, поэтому делаем следующее:


Редактирование файла hosts через приложение nano в «Терминале»

Если желание копаться в файлах, создавать копии и переносить их из папки в папку не хочется, а нужно быстро отредактировать файл hosts, то это можно сделать через редактор текстов nano в «Терминале». Для этого:


Обновление кэша DNS

Все изменения вносятся в реальном времени, и обычно они сразу оказывают эффект на работу сети. Если этого не произошло, то необходимо сделать сброс параметров DNS. Для этого:

  • Открываем «Терминал» (как это сделать описано в «Редактирование файла hosts через приложение nano в Терминале»).
  • Вводим в него команду dscacheutil - flushcache; sudo kilall -HUP mDNSResponder .

После этого новый файл hosts точно заработает.

Зачем изменять файл hosts?

Блокировка рекламы или ускорение загрузки сайтов

Можно вписать в hosts домен сайта, распространяющего рекламу, и перенаправить его на адрес 127.0.0.1. Туда же можно прописать сайты, которые вы хотите сделать недоступными на компьютере. Просто сопоставляем адрес сайта с вышеописанным IP-адресом и все.

Администратор сети может ускорить загрузку сайтов, отредактировав файл hosts. Достаточно внести туда домен сайта и привязать к нему реальный IP-адрес соответствующего ресурса. Таким же образом делаются перенаправления внутри локальной сети.

Сброс параметров iOS через hosts

Есть и более практическое применение. Чаще всего к редактированию hosts прибегают те, кто взломал прошивку мобильного устройства Apple.

При их прошивке используется программа TinyUmbrella. Она заменяет конфигурацию файла hosts, чтобы при необходимости можно было установить устаревшую версию iOS или устаревшую версию программ из App Store на взломанный гаджет.

Эти изменения впоследствии мешают восстановить смартфон или планшет через iTunes. То есть установить официальную прошивку уже не получится. Компьютер не сможет связаться с серверами Apple, так как в файле hosts появится дополнительная строка 74.208.105.171 gs.apple.com, перенаправляющая на серверы разработчиков программного обеспечения для взлома iOS.

Поэтому, перед тем как переустанавливать систему на мобильном устройстве, придется удалить эту строку.

Post Views: 17