1baafe
diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in
1baafe
index eb622d1..37053a7 100644
1baafe
--- a/bin/named/Makefile.in
1baafe
+++ b/bin/named/Makefile.in
1baafe
@@ -117,8 +117,12 @@ SRCS =		builtin.c config.c control.c \
1baafe
 		tkeyconf.c tsigconf.c zoneconf.c \
1baafe
 		${DLZDRIVER_SRCS} ${DBDRIVER_SRCS}
1baafe
 
1baafe
+EXT_CFLAGS = -fpie
1baafe
+
1baafe
 @BIND9_MAKE_RULES@
1baafe
 
1baafe
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
1baafe
+
1baafe
 main.@O@: main.c
1baafe
 	${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
1baafe
 		-DVERSION=\"${VERSION}\" \
1baafe
diff --git a/bin/named/unix/Makefile.in b/bin/named/unix/Makefile.in
1baafe
index fd9ca8d..f1c102c 100644
1baafe
--- a/bin/named/unix/Makefile.in
1baafe
+++ b/bin/named/unix/Makefile.in
1baafe
@@ -11,6 +11,8 @@ srcdir =	@srcdir@
1baafe
 VPATH =		@srcdir@
1baafe
 top_srcdir =	@top_srcdir@
1baafe
 
1baafe
+EXT_CFLAGS = -fpie
1baafe
+
1baafe
 @BIND9_MAKE_INCLUDES@
1baafe
 
1baafe
 CINCLUDES =	-I${srcdir}/include -I${srcdir}/../include \