Resolve conf mac os

Question: Q: How to Check the /etc/resolv.conf file?

I am trying to figure if my manually provided DNS addresses are higher priority than DHCP.

In reference to this thread:

it mentions: «a check of the /etc/resolv.conf file generated by Mac OS X shows that in fact user-provided DNS addresses will supercede any provided by DHCP.»

How, exactly, do I check this «/etc/resolv.conf file» mentioned here?

I am not to technical when it comes to these things.

Thanks for any help.

Posted on Apr 29, 2012 12:19 PM

Helpful answers

In Finder’s Menu, select Go menu>Go to Folder, and go to.

Find resolv.conf in the window that opens & drag it to Text Edit’s icon.

Apr 29, 2012 12:38 PM

I think it may be, is thee a place in your Router to change that?

Apr 29, 2012 8:54 PM

There’s more to the conversation

Loading page content

Page content loaded

In Finder’s Menu, select Go menu>Go to Folder, and go to.

Find resolv.conf in the window that opens & drag it to Text Edit’s icon.

Apr 29, 2012 12:38 PM

Thanks for your quick response.

I’m actually trying to make the opnedns a priority over the comcast ones (that are greyed out and can’t seem to be removed). Do you know of any way to accompish this? I would apprciate any help. Thanks.

Apr 29, 2012 12:47 PM

Have you put OpenDNS’s numbers into your Router/Modem?

Apr 29, 2012 12:52 PM

Apr 29, 2012 12:54 PM

What is the list yours shows?

BTW, that’s an Alias to.

Which will display the same thing.

Apr 29, 2012 1:17 PM

Thanks again for your help.

Here is what mine shows:

The «domain hsd1.ca.comcast.net.» is shown under «search domains» field in the DNS tab in network settings.

SO. has openDNS been set as the primary? I seem to no longer see the comcast ones in the DNS servers tab.

Apr 29, 2012 5:13 PM

It looks to me like openDNS is the primary one, enter a search criteria into the URL bar instead of the Search bar, does that have openDNS’ results?

Apr 29, 2012 6:33 PM

Yes, it says OpenDns Guide in the top left corner.

Apr 29, 2012 6:48 PM

I think we may have done it, but what does Network Prefs say for Search domains?

Apr 29, 2012 7:04 PM

Are you referring to when I go to: system preference/network/advanced/DNS and it shows the «DNS servers» and to the right «Search Domains»? If so, under search domains, greyed out, it says: hsd1.ca.comcast.net. Does this need to be changed? Can this be changed?

OR, are you referring to something else?

Apr 29, 2012 7:35 PM

That’s the one, not sure how it really affects DNS searches though.

Are you experiencing any lags or problems.

Apr 29, 2012 7:36 PM

I originally started this thread because many of the links I was clicking on for Google searches were getting redirected to other sites. At first I thought it to be some sort of virus, but after researhing discovered the whole DNS thing.

I don’t seem to be experiencing any sort of lags or problems at this time.

Читайте также:  Ваша операционная система не поддерживает алгоритм хеширования sha 256 windows 10

Do you think the «hsd1.ca.comcast.net.» under the Search Domains tab need to be changed or removed, or do you think I should just leave it alone? Like I mentioned, when I enter search criteria into the URL bar, it shows OpenDns Guide.

Apr 29, 2012 7:47 PM

Ok, I AM experiencing problems again.

I thought the google redirect problem had gone away, but it just happened again.

Going back to my original post, I tried adding «opendns.com» to the Search Domains tab, and now checking the

/etc/resolv.conf file it reads:

search opendns.com hsd1.ca.comcast.net.

Is it possible i am still getting redirected because the «hsd1.ca.comcast.net.» is still showing in the Search Domains tab? Is there any way you can think of to erase this hsd1.ca.comcast.net. ?

Again, I really appreciate all of your help.

Источник

Resolv.conf on containers not using data from host #684

Comments

phlcastro commented Sep 21, 2016

Expected behavior

According to docs, all records on host file resolv.conf will be copied to the container.
So I create a few record lines in the /etc/resolv.conf file expecting to see them on resolv.conf file inside my containers.

Actual behavior

No record is copied from host to container ( search or nameserver records)

Information

Diagnostic Id: 2819C68F-61EB-4BDB-89C9-FD673AF91D17

Docker for Mac: version: 1.12.1 (2d5b4d9)
OS X: version 10.11.6 (build: 15G31)
logs: /tmp/2819C68F-61EB-4BDB-89C9-FD673AF91D17/20160920-225600.tar.gz
[OK] docker-cli
[OK] virtualization kern.hv_support
[OK] menubar
[OK] moby-syslog
[OK] dns
[OK] disk
[OK] system
[OK] app
[OK] osxfs
[OK] virtualization VT-X
[OK] db
[OK] slirp
[OK] logs
[OK] env
[OK] vmnetd
[OK] moby-console
[OK] moby
[OK] driver.amd64-linux

Steps to reproduce the behavior

  1. Customize host resolv.conf file
  2. Run your image (ie.: ubuntu)
  3. Check container resolv.conf file and verify if it matches

Other info

Tried with latest beta, same issue.
Records present on scutil —dns are also not imported to container.
The only way I made it work was using —dns= when first run a container

The text was updated successfully, but these errors were encountered:

dsheets commented Sep 29, 2016

Could you point out where in the docs we discuss copying resolv.conf into containers? I believe we source DNS resolution configuration from the host and handle it transparently in the network stack. Are you having issues with DNS resolution? Are particular parts of the configuration not being obeyed?

I don’t believe you will see any change inside of a container file system when DNS settings are updated. One reason for this design is that it allows us to transparently switch DNS resolution configuration when mobile users move from network to network or onto/off-of a VPN without the container having to understand these changes.

samoht commented Nov 3, 2016

This issue has been inactive for more than 14 days while marked as status/0-more-info-needed . It is being closed due to abandonment. Please feel free to re-open with more information about the problem.

markwilson commented Feb 1, 2017 •

Docker makes each container’s /etc/resolv.conf look like the /etc/resolv.conf of the host machine (where the docker daemon runs)

I’ve been trying to work out how I can connect to my host machine to connect to a MySQL DB (running on my Mac) without providing this as an extra host. Providing it as an extra host means I need to regularly change it as I connect to different networks and have a different network IP. Using the bridge network’s gateway IP doesn’t allow me to connect to anything, only ICMP communications seem to work.

samoht commented Feb 1, 2017

@markwilson I am not sure why you are commenting on this closed issue, but are you asking for #155 ? We have an update on this planning soon, so you might be interested to watch that issue for updates.

phlcastro commented Feb 1, 2017

@samoht I dont think this issue is related to the #155

I didnt replied it before because I didnt receive the update from github and forgot to come back here.

Читайте также:  Mac os monterey beta download

@markwilson was replying @dsheets question of where did I find the documentation saying that records from resolv.conf on host would be copied to the container resolv.conf file.

phlcastro commented Feb 1, 2017

@samoht sorry, but I dont know how to reopen this issue

samoht commented Feb 1, 2017

@phlcastro no pb. Do you still have that issue with the latest beta/stable?

phlcastro commented Feb 2, 2017

@samoht same problem using stable 1.13.0 (15072)

samoht commented Feb 2, 2017 •

Ok sorry I read your issue again and this is indeed expected.

As @dsheets said above, Docker for Mac does some «magic» (using vpnkit) to transparently route the network traffic from the containers (running inside a Linux VM, as well as the docker daemon) to your macOS networking stack. VPNKit is automatically updated when you update /etc/resolv.conf but it doesn’t update the VM (and containers) network configuration.

If your use-case is trying to connect back to your localhost from a container (for instance to access an open port), we are working on a solution to #155 which could help you. If not, we are very interested to hear about your use-case to see how we can handle it.

phlcastro commented Feb 2, 2017

I was trying to have my container (Ubuntu) being able to resolve hostnames from a VPN connection.
So instead of updating the resolv.conf each time I ran the container, I wondered if I could set it on host and have it automatically updated on containers.

dave-tucker commented Feb 17, 2017

Closing as 0-wont-fix as this behavior is expected.

I was trying to have my container (Ubuntu) being able to resolve hostnames from a VPN connection.

This should work, but there are some open issues with VPN DNS Servers not reliably being detected. That said, the support has got a lot better for this in the last few releases.

Источник

systemd-resolved (Русский)

systemd-resolved — служба systemd, выполняющая разрешение сетевых имён для локальных приложений посредством D-Bus, NSS-службы resolve (см. nss-resolve(8) ) или локальной слушающей DNS-заглушки на адресе 127.0.0.53 . Подробнее об использовании см. systemd-resolved(8) .

Contents

Установка

systemd-resolved входит в пакет systemd , который установлен по умолчанию.

Настройка

Настройки распознавателя можно изменить в файле /etc/systemd/resolved.conf и/или с помощью drop-in-файлов с суффиксом .conf в каталоге /etc/systemd/resolved.conf.d/ . См. resolved.conf(5) .

Для запуска systemd-resolved запустите и включите службу systemd-resolved.service .

systemd-resolved может выполнять разрешение доменных имён четырьмя различными способами. Все четыре режима работы подробно описаны в руководстве systemd-resolved(8) § /ETC/RESOLV.CONF . Наиболее часто используются следующие два:

  1. С файлом DNS-заглушки systemd — файл /run/systemd/resolve/stub-resolv.conf содержит указание использовать локальную заглушку (local stub) на адресе 127.0.0.53 в качестве единственного DNS-сервера, а также список доменов для поиска. Это рекомендуемый режим работы. Файл /etc/resolv.conf стоит заменить символической ссылкой на файл заглушки, чтобы все процессы использовали последний при разрешения имён:
  2. С файлом resolv.confsystemd-resolved работает с файлом /etc/resolv.conf как обычный клиент. Этот режим менее разрушителен, поскольку другие программы по-прежнему смогут использовать /etc/resolv.conf .

Выбор DNS-серверов

Автоматически

systemd-resolved работает «из коробки» с сетевыми менеджерами, использующими файл /etc/resolv.conf . Никаких дополнительных настроек не требуется, поскольку systemd-resolved будет автоматически обнаружен при переходе по символической ссылке /etc/resolv.conf . Во всяком случае, это работает для systemd-networkd и NetworkManager.

Тем не менее, если какой-то DHCP- или VPN-клиент настраивает сервера имён и домены поиска с помощью resolvconf (список использующих resolvconf программ приведён в статье openresolv#Пользователи), то необходимо дополнительно установить пакет systemd-resolvconf , который предоставляет символическую ссылку /usr/bin/resolvconf .

Вручную

В режиме локальной DNS-заглушки можно назначить произвольные DNS-серверы, указав их в файле resolved.conf(5) :

. , то systemd-resolved может использовать DNS-серверы из настроек отдельных сетевых интерфейсов, если параметр Domains=

. в них есть.

  • Данная опция не повлияет на запросы доменных имён, которые совпадают с каким-то более точным поисковым доменом из настроек интерфейса — разрешение таких имён будет выполняться посредством соответствующих «интерфейсных» DNS-серверов.
  • Подробнее о настройках для сетевых интерфейсов см. systemd-networkd#Файлы network.

    Резерв

    Если systemd-resolved не получает адреса DNS-серверов от сетевого менеджера и никакие сервера не были настроены вручную, то он использует специальные зарезервированные DNS-адреса. Таким образом, разрешение доменных имён работает всегда.

    Читайте также:  Компьютер перестал видеть флешку что делать windows 10

    Изменить адреса можно с помощью параметра FallbackDNS= в файле resolved.conf(5) , например:

    Чтобы полностью отключить функциональность резервных DNS-серверов, задайте параметр FallbackDNS без указания адреса:

    DNSSEC

    Проверка DNSSEC настраивается параметром DNSSEC= в файле resolved.conf(5) .

    • DNSSEC=allow-downgrade — проверка выполняется только в том случае, если опрашиваемый сервер её поддерживает.
    • DNSSEC=true — проверка выполняется всегда; если сервер не поддерживает DNSSEC, то разрешение доменных имён работать не будет. Пример:

    Проверьте, работает ли DNSSEC, отправив запрос к домену с неправильной подписью:

    Затем проверьте домен, подпись которого в порядке:

    DNS over TLS

    DNS over TLS по умолчанию не работает. Чтобы его включить, задайте параметр DNSOverTLS= в разделе [Resolve] файла resolved.conf(5) . Чтобы включить проверку сертификата DNS вашего провайдера, добавьте соответствующее имя хоста в параметр DNS= в формате ip_адрес#имя_хоста . Например:

    С помощью ngrep можно проверить, работает ли DNS over TLS. В этом режиме для DNS-запросов используется порт 853 (вместо стандартного 53). По этой причине при разрешении имени с DoT команда ngrep port 53 не выдаст ничего, а команда ngrep port 853 выведет зашифрованные данные.

    Wireshark позволяет более подробно изучить пакеты запросов и ответов DNS over TLS. Установить Wireshark можно с пакетами wireshark-cli и wireshark-qt .

    systemd-resolved может работать в режиме multicast DNS, причём и как распознаватель (resolver), так и как передатчик (responder).

    Распознаватель выполняет разрешение имени хоста по схеме «имя_хоста.local»

    mDNS будет работать для конкретного соединения только в том случае, если он включён одновременно и в глобальных настройках systemd-resolved (параметр MulticastDNS= в resolved.conf(5) ), и в настройках сетевого менеджера для данного соединения. systemd-resolved по умолчанию работает как mDNS-передатчик, но systemd-networkd и NetworkManager [1] требуют дополнительных настроек, чтобы включить этот режим для соединений:

    • Для systemd-networkd — задайте параметр MulticastDNS= в разделе [Network] , а также Multicast=yes в разделе [Link] . См. systemd.network(5) .
    • Для NetworkManager — задайте параметр mdns= в разделе [connection] . См. nm-settings(5) . Также необходимо включить режим mDNS для каждого сетевого интерфейса, на котором он будет использоваться: systemd-resolve —set-mdns=yes —interface=имя_интерфейса .

    Если вы планируете использовать mDNS при работающем межсетевом экране, не забудьте открыть UDP-порт 5353 .

    LLMNR

    LLMNR будет работать для конкретного соединения только в том случае, если он включён одновременно и в глобальных настройках systemd-resolved (параметр LLMNR= в resolved.conf(5) ), и в настройках сетевого менеджера для данного соединения. systemd-resolved по умолчанию работает как LLMNR-передатчик, но systemd-networkd и NetworkManager [2] требуют дополнительных настроек, чтобы включить этот режим для соединений:

    • Для systemd-networkd — задайте параметр LLMNR= в разделе [Network] . См. systemd.network(5) .
    • Для NetworkManager — задайте параметр llmnr= в разделе [connection] . См. nm-settings(5) .

    Если вы планируете использовать LLMNR при работающем межсетевом экране, не забудьте открыть UDP- и TCP-порт 5355 .

    Запросы

    С помощью утилиты resolvectl можно отправлять запросы к DNS-серверам, а также к mDNS- или LLMNR-хостам.

    Например, DNS-запрос выглядит следующим образом:

    Решение проблем

    systemd-resolved не ищет в локальном домене

    Иногда systemd-resolved не может выполнить поиск в локальном домене при передаче ему только имени хоста. При этом возможна ситуация, когда с формальной точки зрения всё в порядке — в соответствующем .network-файле systemd-networkd присутствуют параметры UseDomains=yes или Domains=[список_доменов] , в результате чего в файле resolv.conf , как и положено, появилась строка search [список_доменов] . Запустите networkctl status или resolvectl status , чтобы убедиться, что домены для поиска в самом деле были обнаружены и собраны.

    • Отключите LLMNR, чтобы systemd-resolved начал присоединять DNS-суффиксы.
    • Отредактируйте базу данных hosts в файле /etc/nsswitch.conf (например, удалите опцию [!UNAVAIL=return] после службы resolve ).
    • Перейдите на использование полных доменных имён.
    • Используйте файл /etc/hosts для разрешения имён.
    • Используйте службу dns из библиотеки glibc вместо resolve из systemd.

    systemd-resolved не выполняет разрешение имён без суффикса

    Чтобы systemd-resolved выполнял разршение частичных доменных имён, добавьте параметр ResolveUnicastSingleLabel=yes в /etc/systemd/resolved.conf .

    Судя по всему, это работает только с отключённым LLMR ( LLMR=no ).

    Если вы используете systemd-networkd, то можно использовать в качестве поискового домен, предоставленный DHCP-сервером или IPv6 Router Advertisement. По умолчанию эта возможность отключена; для включения добавьте следующие строки в .network-файл сетевого интерфейса:

    Проверить домены для всех интерфейсов можно командой:

    Источник

    Оцените статью