- MAX666
- MAX667
- MCP1700
- XC6206
- XC6216
- LP2950
- LTC3440
Versorgung aus einer Zelle
Stromsparen + Festspannungsregler
Versorgung aus einer Zelle
Stromsparen + Festspannungsregler
BIND 9.9.7
BIND 9.9.5
Time-to-Live (TTL) Values
Start of Authority Resource Record (SOA)
BIND Time formats
IPv6 Address Record (AAAA)
HOWTO Close an Open DNS
DNS BIND Query Statements
DNS Configuration Types
DNS Sample BIND Configurations
$ORIGIN, @ and blank Substitution
DNS BIND9 logging Clause
#s = seconds = # x 1 seconds (really!)
#m = minutes = # x 60 seconds
#h = hours = # x 3600 seconds
#d = day = # x 86400 seconds
#w = week = # x 604800 seconds
# pkg install bind-tools
May you please add alias for nslookup?
FreeBSD 10 sysinstall, nslookup
# chown -R bind:bind /var/named/etc/namedb
named: the working directory is not writable
# rndc-confgen -a
Bind does not provide /etc/rndc.key
Die Verwendung von rndc
Using rndc
Stopping named: rndc failed, trying killall: .
options {
dump-file "/var/named/dump/named_dump.db";
statistics-file "/var/named/stats/named.stats";
};
rndc works, but rndc stats doesnt
rndc dumpdb could not open dump file
DNS-Request
- autoritativ (der Server holt die Daten aus einer lokalen Zonendatei)
- nicht-autoritativ
o rekursiv (der Server holt die Daten von einem anderen Nameserver)
o iterativ (der Server antwortet mit einem oder mehreren Verweisen
oder einem Resource Record auf andere Nameserver)
Rekursive und iterative Namensauflösung
recursion
If yes, and a DNS query requests recursion, then the server will attempt to do all the work required to answer the query. If recursion is off and the server does not already know the answer, it will return a referral response. The default is yes. Note that setting recursion no does not prevent clients from getting data from the server’s cache; it only prevents new data from being cached as an effect of client queries. Caching may still occur as an effect the server’s internal operation, such as NOTIFY address lookups. See also fetch-glue above.
fetch-glue
This option is obsolete. In BIND 8, fetch-glue yes caused the server to attempt to fetch glue resource records it didn’t have when constructing the additional data section of a response. This is now considered a bad idea and BIND 9 never does it.
BIND 9 Configuration Reference
Problem
You want to configure an “authoritative-only” or nonrecursive name server.
Cooking with DNS & BIND
(dns) && (dns.qry.type == 1) => Record type A
$ tcpdump -s 1500 -p 53 -w output.pcap -s <number> number in bytes per packet -w <file> output file -p <number> port number (ex. 53 = DNS)
Fail2Ban
DNS Root Query Amplification with Fail2Ban
Fail2Ban with FreeBSD
Integrating PF with Fail2ban 0.9
A Nonrecursive Name Server, O’Reilly DNS and BIND
How to Disable External DNS recursion?
Configuring Bind Non Recursive
Wikipedia: Rekursive und iterative Namensauflösung
What is a “recursive DNS query”?
# /usr/sbin/named -t /var/named -u bind -fg -t chroot() to directory after processing the command line arguments -u setuid() to user after completing privileged operations -f Run the server in the foreground -g Run the server in the foreground and force all logging to stderr
recursion no; # /usr/sbin/named -t /var/named -u bind -fg 05-Aug-2013 19:58:10.872 starting 05-Aug-2013 19:58:10.876 listening on IPv4 interface em0, 1.2.3.4#53 05-Aug-2013 19:58:10.877 listening on IPv4 interface lo0, 127.0.0.1#53 05-Aug-2013 19:58:10.880 running 05-Aug-2013 19:59:11.360 unexpected RCODE (REFUSED) resolving 'www.XXX.ch/A/IN': 1.2.3.4#53 05-Aug-2013 19:59:13.359 lame server resolving 'blog.XXX.net' (in 'XXX.net'?): 1.118.193.3#53 05-Aug-2013 19:59:13.359 lame server resolving 'blog.XXX.net' (in 'XXX.net'?): 2.134.128.59#53 05-Aug-2013 19:59:13.360 lame server resolving 'blog.XXX.net' (in 'XXX.net'?): 2.134.128.59#53 05-Aug-2013 19:59:13.361 lame server resolving 'blog.XXX.net' (in 'XXX.net'?): 1.118.193.3#53 05-Aug-2013 20:00:22.718 shutting down 05-Aug-2013 20:00:22.719 no longer listening on 1.2.3.4#53 05-Aug-2013 20:00:22.719 no longer listening on 127.0.0.1#53 05-Aug-2013 20:00:22.720 exiting
# /usr/local/sbin/named -t /var/named -u bind -fg -c /etc/namedb/named.conf 29-Sep-2015 20:16:29.117 starting BIND x.x.x. -t /var/named -u bind -fg -c /etc/namedb/named.conf 29-Sep-2015 20:16:29.117 found 2 CPUs, using 2 worker threads 29-Sep-2015 20:16:29.117 using 2 UDP listeners per interface 29-Sep-2015 20:16:29.120 using up to 4096 sockets 29-Sep-2015 20:16:29.137 ENGINE_by_id failed (crypto failure) 29-Sep-2015 20:16:29.138 error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244: 29-Sep-2015 20:16:29.138 error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450: 29-Sep-2015 20:16:29.138 error:2606A074:engine routines:ENGINE_by_id:no such engine:eng_list.c:417:id=gost 29-Sep-2015 20:16:29.140 initializing DST: crypto failure 29-Sep-2015 20:16:29.140 exiting (due to fatal error) # /usr/local/sbin/named -u bind -fg -c /etc/namedb/named.conf 29-Sep-2015 20:16:51.826 starting BIND x.x.x -u bind -fg -c /etc/namedb/named.conf 29-Sep-2015 20:16:51.826 found 2 CPUs, using 2 worker threads 29-Sep-2015 20:16:51.826 using 2 UDP listeners per interface 29-Sep-2015 20:16:51.829 using up to 4096 sockets 29-Sep-2015 20:16:51.853 loading configuration from '/etc/namedb/named.conf' 29-Sep-2015 20:16:51.855 using default UDP/IPv4 port range: [49152, 65535] 29-Sep-2015 20:16:51.855 using default UDP/IPv6 port range: [49152, 65535] 29-Sep-2015 20:16:51.856 listening on IPv4 interface em0, 195.134.157.20#53 29-Sep-2015 20:16:51.858 listening on IPv4 interface lo0, 127.0.0.1#53 [...] 29-Sep-2015 20:16:51.891 command channel listening on 127.0.0.1#953 29-Sep-2015 20:16:51.891 not using config file logging statement for logging due to -g option 29-Sep-2015 20:16:51.892 managed-keys-zone: loaded serial 0 29-Sep-2015 20:16:51.893 redirect-zone: loaded serial 2014060401 29-Sep-2015 20:16:51.907 zone 157.x.x.in-addr.arpa/IN: loaded serial 2007020101 29-Sep-2015 20:16:51.912 zone xxx.ch/IN: loaded serial 2007020101 29-Sep-2015 20:16:51.929 zone yyy.ch/IN: loaded serial 2007020101 29-Sep-2015 20:16:51.930 all zones loaded 29-Sep-2015 20:16:51.933 running
What is the meaning of these BIND log messages?
allow-recursion { 127.0.0.1; };
05-Aug-2013 20:05:39.820 starting
05-Aug-2013 20:05:39.824 loading configuration from '/etc/namedb/named.conf'
05-Aug-2013 20:05:39.825 listening on IPv4 interface em0, 1.2.3.4#53
05-Aug-2013 20:05:39.825 listening on IPv4 interface lo0, 127.0.0.1#53
05-Aug-2013 20:05:39.830 zone 0.0.127.in-addr.arpa/IN: loaded serial 2007020101
05-Aug-2013 20:05:39.832 zone AAA.ch/IN: loaded serial 2007020101
05-Aug-2013 20:05:39.833 zone BBB.ch/IN: loaded serial 2007020101
05-Aug-2013 20:05:39.833 zone CCC.ch/IN: loaded serial 2007020101
05-Aug-2013 20:05:39.834 zone DDD.ch/IN: loaded serial 2007020101
05-Aug-2013 20:05:39.835 zone localhost/IN: loaded serial 2007020101
05-Aug-2013 20:05:39.837 running
05-Aug-2013 20:05:39.837 zone localhost/IN: sending notifies (serial 2007020101)
05-Aug-2013 20:05:39.838 zone AAA.ch/IN: sending notifies (serial 2007020101)
05-Aug-2013 20:05:39.838 zone BBB.net/IN: sending notifies (serial 2007020101)
05-Aug-2013 20:05:39.838 zone CCC.net/IN: sending notifies (serial 2007020101)
05-Aug-2013 20:05:39.838 zone DDD.net/IN: sending notifies (serial 2007020101)
05-Aug-2013 20:05:39.838 zone 0.0.127.in-addr.arpa/IN: sending notifies (serial 2007020101)
05-Aug-2013 20:05:39.838 client 1.2.3.4#56328: received notify for zone 'localhost'
05-Aug-2013 20:05:40.339 client 1.2.3.4#56328: received notify for zone 'AAA.ch'
05-Aug-2013 20:05:40.339 client 1.2.3.4#56328: received notify for zone 'BBB.net'
05-Aug-2013 20:05:40.340 client 1.2.3.4#56328: received notify for zone 'CCC.net'
05-Aug-2013 20:05:40.340 client 1.2.3.4#56328: received notify for zone 'DDD.net'
05-Aug-2013 20:05:40.840 client 1.2.3.4#56328: received notify for zone '0.0.127.in-addr.arpa'
05-Aug-2013 20:09:10.348 shutting down
05-Aug-2013 20:09:10.348 no longer listening on 1.2.3.4#53
05-Aug-2013 20:09:10.348 no longer listening on 127.0.0.1#53
05-Aug-2013 20:09:10.350 exiting
How to setup Local Authoritative DNS
BIND 10: Authoritative DNS Server
Source:
[1] AVR-GCC-Tutorial/Assembler und Inline-Assembler Wechseln zu: Navigation, Suche
[2] GCC-Inline-Assembly-HOWTO
[3] Wikipedia: Integrierter Assembler
[4] AVR-GCC Inline Assembler Cookbook
[5] RoboterNETZ: Inline-Assembler in avr-gcc
How to get gcc to interleave assembly output with original source code
The pgm_read_byte() is a macro that reads a byte of data stored in a specified address(PROGMEM area).
The pgm_read_byte() is defined in hardware/tools/avr/avr/include/avr/pgmspace.h as below.
#define pgm_read_byte(address_short) pgm_read_byte_near(address_short)
The input is address_short and calls the pgm_read_byte_near() macro.
The pgm_read_byte_near() is a macro that reads a byte of data stored in a specified address(PROGMEM area).
The pgm_read_byte_near() is defined in hardware/tools/avr/avr/include/avr/pgmspace.h as below.
#define pgm_read_byte_near(address_short) __LPM((uint16_t)(address_short))
The input is address_short and the macro converts the address_short to uint16_t, then calls __LPM() macro.
The __LPM() is a macro that reads a byte of data stored in a specified address(PROGMEM area).
The __LPM() is defined in hardware/tools/avr/avr/include/avr/pgmspace.h as below.
#define __LPM(addr) __LPM_enhanced__(addr)
The input is addr and just calls __LPM_enhanced__().
See Intrinsic Functions
The __LPM_enhanced() is an assembler code that reads a byte of data stored in a specified address(PROGMEM area).
The __LPM_enhanced() is defined in hardware/tools/avr/avr/include/avr/pgmspace.h as below.
#define __LPM_enhanced__(addr) \
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
uint8_t __result; \
__asm__ \
( \
"lpm %0, Z" "\n\t" \
: "=r" (__result) \
: "z" (__addr16) \
); \
__result; \
}))
or newer avr-libc
#define __LPM_classic__(addr) \
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
uint8_t __result; \
__asm__ \
( \
"lpm" "\n\t" \
"mov %0, r0" "\n\t" \
: "=r" (__result) \
: "z" (__addr16) \
: "r0" \
); \
__result; \
}))
The lpm, short for Load Program Memory, is a instruction that reads a byte of data from PROGMEM area. It substitue a data at addr for __result, then returns the __result.
Sources:
pgm_read_byte() marco
pgm_read_byte_near() marco
__LPM() marco
__LPM_enhanced__() marco
/* pin = Arduino Mapped Pin Name, ex. Digital pin 22: pin = 22 */
void digitalWrite(uint8_t pin, uint8_t val)
{
uint8_t timer = digitalPinToTimer(pin);
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
volatile uint8_t *out;
out = portOutputRegister(port);
uint8_t oldSREG = SREG;
cli();
if (val == LOW) {
*out &= ~bit;
} else {
*out |= bit;
}
SREG = oldSREG;
}
SREG (Status Register) und Globale Interrupts aktivieren: SREG -Register
extern const uint8_t PROGMEM digital_pin_to_port_PGM[]; #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
#define pgm_read_byte(address_short) pgm_read_byte_near(address_short) #define pgm_read_byte_near(address_short) __LPM((uint16_t)(address_short))
Was pgm_read_byte() macht bzw. wie es in Assembler übersetzt wird: Source von pgm_read_byte
C:\arduino-1.0.4\hardware\tools\avr\avr\include C:\arduino-1.0.4\hardware\arduino\cores\arduino
const uint16_t PROGMEM port_to_mode_PGM[] = {
NOT_A_PORT,
&DDRA,
&DDRB,
&DDRC,
&DDRD,
&DDRE,
&DDRF,
&DDRG,
&DDRH,
NOT_A_PORT,
&DDRJ,
&DDRK,
&DDRL,
};
/arduino/variants/mega/pins_arduino.h
Accessing data past 64k boundary on atmega1280
| MPU-6050 | 3x Axis accelerometer sensor and 3x Axis gyroscope sensor |
| MPU-9150 | Nine-Axis (Gyro + Accelerometer + Compass) MEMS MotionTracking (MPU-6050 + AK8975) |
| AK8975 | 3-axis electronic compass |
| HMC5883L | Triple Axis Magnetometer |
| BMP180 | Barometric Pressure Sensor |
| L3GD20 | 3-axis digital gyroscope |
| LSM303D | 3D accelerometer and 3D magnetometer |
| TMP006 | Infrared Thermopile Sensor |
| AM2302 | humidity capacitor module |
| AM2321 | capacitive humidity sensing digital temperature and humidity sensor |
| SHT21 | 3-axis electronic compass |
| SHT11 | Triple Axis Magnetometer |
| SHT15 | Barometric Pressure Sensor |
AM2302 (wired DHT22) temperature-humidity sensor
Sensirion Temperature/Humidity Sensor – SHT11
Arduino – Temperatur und Luftfeuchtigkeit mit dem DHT22 prüfen.
Erfahrungen mit 1-Wire Temp/Feuchte-Sensor AM2305 (anderer Sensor)
| ISL29023 | Integrated Digital Light Sensor with Interrupt |
unsigned int bcd2i(unsigned int bcd) {
unsigned int decimalMultiplier = 1;
unsigned int digit;
unsigned int i = 0;
while (bcd > 0) {
digit = bcd & 0xF;
i += digit * decimalMultiplier;
decimalMultiplier *= 10;
bcd >>= 4;
}
return i;
}
unsigned int i2bcd(unsigned int i) {
unsigned int binaryShift = 0;
unsigned int digit;
unsigned int bcd = 0;
while (i > 0) {
digit = i % 10;
bcd += (digit << binaryShift);
binaryShift += 4;
i /= 10;
}
return bcd;
}