Member_2_8088314
asked on
modify a record entry in Ubuntu bind/dns server
Hi All,
query : xyz> dig abc.com showing two pointing adresss
ie. answer section : A 1.1.1.1 AND
A 2.2.2.2
i am unable to find directory file where i can remove one entry .
tried following cat /etc/resolve.conf and cat etc/bind/db and cat /etc/bind/name and cat/etc/bind/ but nowhere showing that entry
in Ubuntu dns server.
can you folk help me to remove that 2.2.2.2 pointing .
-ANkush
query : xyz> dig abc.com showing two pointing adresss
ie. answer section : A 1.1.1.1 AND
A 2.2.2.2
i am unable to find directory file where i can remove one entry .
tried following cat /etc/resolve.conf and cat etc/bind/db and cat /etc/bind/name and cat/etc/bind/ but nowhere showing that entry
in Ubuntu dns server.
can you folk help me to remove that 2.2.2.2 pointing .
-ANkush
ASKER
hi noci,
i tried checking name/host/db files but nowhere i found entry or database.
but nslookup and dig still showing the record.
i tried checking name/host/db files but nowhere i found entry or database.
but nslookup and dig still showing the record.
Ah... You're likely having problems with the ridiculously broken systemd-resolved code.
This code is a built in resolver managed by systemd. It has never worked + likely will never work + will put you in a straight jacket in no time, trying to debug it's nonsense.
Hint: You'll never get this code working + you'll never be able to fix any DNS issues while it's running.
First off, before I go into the gory details of how to nuke it completely, see if it's running by posting output of...
Actually I just found my nuke 'em notes in a server/container setup script I use, so here's how to nuke the code where resolved is dead + will never arise from the dead, as a side effect of a package update (which is frequent).
There are also some other actions you may take, such as replacing bind with dnsmasq, if you're only running a caching server... so...
Guideline: Only run bind/named is your answering zone record resolution requests, other wise run dnsmasq.
This code is a built in resolver managed by systemd. It has never worked + likely will never work + will put you in a straight jacket in no time, trying to debug it's nonsense.
Hint: You'll never get this code working + you'll never be able to fix any DNS issues while it's running.
First off, before I go into the gory details of how to nuke it completely, see if it's running by posting output of...
systemctl status systemd-resolved | grep loaded
ps fauxww | grep resolved | grep -v grep
netstat -pluten | grep systemd-resolv
Actually I just found my nuke 'em notes in a server/container setup script I use, so here's how to nuke the code where resolved is dead + will never arise from the dead, as a side effect of a package update (which is frequent).
systemctl stop systemd-resolved
systemctl --now disable systemd-resolved
systemctl mask systemd-resolved
apt-get purge libnss-systemd libnss3
systemctl status systemd-resolved | grep loaded
There are also some other actions you may take, such as replacing bind with dnsmasq, if you're only running a caching server... so...
Guideline: Only run bind/named is your answering zone record resolution requests, other wise run dnsmasq.
bind can also include files.. so it may be a bit more complex then i assumed... and the named.conf might have another name of bein another directory. (ps axl | grep named ) should show if there is a different config file.
Also check nsswitch.conf of there is a possibility ldap (or other lookups) has been configured for host / network lookup).
about systemd.. well not sure why everyone jumped on that band wagon... SYS-V wasn't nice, but there were/ are better solutions than raping the init system like systemd does. (openrc does a better jobs of this, even from before systemd).
Also check nsswitch.conf of there is a possibility ldap (or other lookups) has been configured for host / network lookup).
about systemd.. well not sure why everyone jumped on that band wagon... SYS-V wasn't nice, but there were/ are better solutions than raping the init system like systemd does. (openrc does a better jobs of this, even from before systemd).
systemd == abomination
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
grep -i directory /etc/bind/named.conf #will show: (f.e.) then the zone files are in files relative to the directory:
directory "/var/bind";
With each zone:
there is a file systement:
grep -i file /etc/bind/named.conf # will show where files are f.e:
file "pri/db.61.168.192.in-addr
in this case the zone file for zone that resolve reverse lookups for 192.168.61.x network:
the file will be in /var/bind/pri/db.61.168.19
When updating the zone file also add one to the serial number in the SOA record
after updating don't forget to restart your name server.